<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Using Mentawai along with Guice"]]></title>
		<link>http://forum.mentaframework.org/posts/list/1.page</link>
		<description><![CDATA[Latest messages posted in the topic "Using Mentawai along with Guice"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Using Mentawai along with Guice</title>
				<description><![CDATA[ Hi Mentawai'ans ;)

I've adopted <a href="http://code.google.com/p/google-guice/" target="_new" rel="nofollow">Google Guice</a> recently. I'm using Guice instead of the Mentawai Dependency Injection functionality since my project consists of several subprojects, only one of them being a web application. Also I think that Guice is more powerful for DI (no offense!) and I like configuration by annotations.

Anyway, I ask myself why the ActionConfig constructor can only take classes and no instances of objects. Latter would improve the integration of Guice in Mentawai:

Let's say there's a SearchAction class. Since the search is performed on a database, an instance of SearchAction holds an instance of Database (the service)

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>class SearchAction extends BaseAction {
  private Database database;

  @Inject
  public SearchAction&#40; Database database &#41; {
    this.database = database;
  }

  // other methods
}</pre>
		</div>
Assuming Guice has been properly configured and an Injector instance has been created, the action could be configured like this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>ActionConfig = new ActionConfig&#40; "/search", injector.getInstance&#40; SearchAction.class &#41; &#41;;</pre>
		</div>
Is there any good reason why the ActionConfig constructor only takes classes? If it would also take instances it could hold these instances until the corresponding action is called.

Even if no DI framework is used this could improve Mentawai because custom constructors of the actions could be called.]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14063</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14063</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 11:07:43]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
The only reason why Mentawai takes classes and NOT instances is because a <b>new instance is created for each new request.</b> This will make the actions thread-safe.

If we make the ActionConfig take an instance, then you must make sure your instance is thread-safe. I have no objection of providing an ActionConfig that takes an instance, but <b>we should not encourage its usage</b>, unless it is really a necessity and the guy knows what he is doing.

Now talking about DI, I also like Guice. I understand that you want to use Guice, but allow me to illustrate how your case can be easily solved with Mentawai DI:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
filter&#40;new IoCFilter&#40;&#41;&#41;;
filter&#40;new InjectionFilter&#40;&#41;&#41;;

ioc&#40;"database", MyDatabaseImpl.class, APPLICATION&#41;; // you can also use REQUEST and SESSION
</pre>
		</div>

And your action:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
class SearchAction extends BaseAction {
   
   private Database database;
 
   // other methods
 }
</pre>
		</div>

You can use a setter, but you do not need one. Injection will happen straight in the private field by the InjectionFilter.



]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14067</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14067</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 12:16:46]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
I think I found out what you were looking for, Sven. Mentawai already comes with it.

SingleInstanceActionConfig: This action config will accept an action instance and it will always return this same instance to all requests:

http://www.mentaframework.org/api/org/mentawai/core/SingleInstanceActionConfig.html

<p></p>

		<cite>API DOC wrote:</cite><br>
		<blockquote>
Use this action config if you want your action to be a single instance for all requests, in other words, you don't want to create a new instance of your action for every request. If you use this action config, it is your responsibility to make your action thread-safe. If you are not sure that your action is thread-safe, than you should not use this action config. Sometimes our actions are so simple (Ex: org.mentawai.action.SuccessAction) that it doesn't make sense to create a new instance for every request.
&nbsp;
		</blockquote>

SingleInstanceBaseAction: Extend this class if you want an single-instance AND single-threaded action. This will make all the action protected members (input, output, session, etc.) thread safe through ThreadLocals.

http://www.mentaframework.org/api/org/mentawai/core/SingleInstanceBaseAction.html

<p></p>

		<cite>API DOC wrote:</cite><br>
		<blockquote>
This is the base class for single instance actions, in other words, those actions that will be instantiated only once and shared among all requests. Sometimes, when you looking for every performance drop, you may not want to create a new action instance for every request. This class keeps the action data in thread locals, so that each thread has its own input, output, session, application and locale. The actions extending this class must be configurated with a SingleInstanceActionConfig. It is your responsibility to make your action thread-safe, otherwise you should stick with the BaseAction class.
&nbsp;
		</blockquote>

But now I am very muched pumped to make an good integration of Guice and Mentawai. :-)]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14069</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14069</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 12:35:39]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ Hello Sergjo,

I didn't think about thread-safety, pardon me!

I could use the SingleInstanceActionConfig but I will also think about a solution how to use Guice with the standard ActionConfig.]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14070</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14070</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 13:32:25]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ By the way, I'm already using Guice functionality which goes beyond that of Mentawai. For example the Database class contains another service, the DatabaseHandler, which does the actual job.

There can be different database handlers, a JDODatabaseHandler and a MockDatabaseHandler (for testing).

Which handler actually is inserted is configured in a Module class.]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14071</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14071</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 13:36:10]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ <blockquote>
I could use the SingleInstanceActionConfig but I will also think about a solution how to use Guice with the standard ActionConfig.
&nbsp;
		</blockquote>

We should think about a filter or something else to provide a very good integration between Mentawai and Guice. Maybe like the <a href="http://www.mentaframework.org/spring.jsp?loc=en" target="_new" rel="nofollow">Spring integration</a>? Let me know if you come up with something. I will take a look on how Guice works and give it a thought as well.

<blockquote>
By the way, I'm already using Guice functionality which goes beyond that of Mentawai. For example the Database class contains another service, the DatabaseHandler, which does the actual job.

There can be different database handlers, a JDODatabaseHandler and a MockDatabaseHandler (for testing).

Which handler actually is inserted is configured in a Module class.
&nbsp;
		</blockquote>

I think you will be fine using Guice, but just as a reference, you can do that very easily with the Mentawai support for auto-wiring.

So you want to insert a DatabaseHandler inside your Database, and the DatabaseHander will have many implementations, right? All you have to do is this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
filter&#40;new IoCFilter&#40;&#41;&#41;;
filter&#40;new DIFilter&#40;&#41;&#41;;
filter&#40;new InjectionFilter&#40;&#41;&#41;;

ioc&#40;"database", MyDatabaseImpl.class&#41;;
ioc&#40;"databaseHandler", JDODatabaseHandler.class&#41;;

// auto-wiring
di&#40;"databaseHandler", DatabaseHandler.class&#41;;
</pre>
		</div>

Take a look in the recipe for more details: http://recipes.mentaframework.org/posts/list/14.page

]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14073</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14073</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 14:02:22]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
Checking here: http://www.mentaframework.org/spring.jsp?loc=en

I think we should create a GuiceActionConfig and a GuiceFilter, pretty much like SpringActionConfig and SpringFilter.

Feel free to help here Sven, but only if you have the time and the desire to play with it. :-)

Thanks dude!]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14076</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14076</link>
				<pubDate><![CDATA[Tue, 29 Jan 2008 14:45:42]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ <p></p>

		<cite>saoj wrote:</cite><br>
		<blockquote>
I think we should create a GuiceActionConfig and a GuiceFilter, pretty much like SpringActionConfig and SpringFilter.

Feel free to help here Sven, but only if you have the time and the desire to play with it. :-)&nbsp;
		</blockquote>
Funny, I also thought that we need a GuiceActionConfig. It should have a constructor like this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>GuiceActionConfig&#40; String, com.google.inject.Injector, Class &#41;</pre>
		</div>

I will see if I have the time to implement it. I still don't know how to implement a GuiceFilter yet, though.]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14077</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14077</link>
				<pubDate><![CDATA[Wed, 30 Jan 2008 01:17:12]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ Ok, here it is! :)

It works in my project but it still needs extensive testing!

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>package org.mentawai.core;

import org.mentawai.core.Action;
import org.mentawai.core.ActionConfig;
import org.mentawai.core.PojoAction;

import com.google.inject.Injector;

/**
 * ActionConfig to tightly integrate Google Guice.
 * 
 * Use this ActionConfig if you want Guice to create your
 * Action instances and resolve all dependencies.
 * 
 * @author Sven Jacobs &lt;sven.jacobs@web.de&gt;
 * @version 0.1
 */
public class GuiceActionConfig extends ActionConfig {
  private Injector injector;
  
  public GuiceActionConfig&#40; Injector injector, Class&lt;? extends Object&gt; klass &#41; {
    super&#40; klass &#41;;
    this.injector = injector;
  }
  
  public GuiceActionConfig&#40; String name, Injector injector, Class&lt;? extends Object&gt; klass &#41;
  {
    super&#40; name, klass &#41;;
    this.injector = injector;
  }
  
  @Override
  public Action getAction&#40;&#41; {
    Object instance = injector.getInstance&#40; actionClass &#41;;
    
    if &#40; Action.class.isAssignableFrom&#40; actionClass &#41; &#41; {
      return &#40;Action&#41;instance;
    } else {
      return new PojoAction&#40; instance &#41;;
    }
  }
}</pre>
		</div>
<b>EDIT:</b> The org.mentawai.core.* imports are unnecessary. I needed them because I placed GuiceActionConfig in a different package. Feel free to remove them :)

]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14078</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14078</link>
				<pubDate><![CDATA[Wed, 30 Jan 2008 01:58:47]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
I haved added this filter to org.mentawai.guice

I changed the order of the constructor parameters and added another constructor.

Take a look:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
package org.mentawai.guice;
 
 import org.mentawai.core.Action;
import org.mentawai.core.ActionConfig;
import org.mentawai.core.PojoAction;

import com.google.inject.Injector;
 
 /**
  * ActionConfig to tightly integrate Google Guice.
  * 
  * Use this ActionConfig if you want Guice to create your
  * Action instances and resolve all dependencies.
  * 
  * @author Sven Jacobs &lt;sven.jacobs@web.de&gt;
  * @version 0.1
  */
 public class GuiceActionConfig extends ActionConfig {
	 
   private Injector injector;
   
   public GuiceActionConfig&#40; Class&lt;? extends Object&gt; klass, Injector injector &#41; {
     super&#40; klass &#41;;
     this.injector = injector;
   }
   
   public GuiceActionConfig&#40; String name, Class&lt;? extends Object&gt; klass, Injector injector &#41; {
     super&#40; name, klass &#41;;
     this.injector = injector;
   }
   
   public GuiceActionConfig&#40; String name, Class&lt;? extends Object&gt; klass, String innerAction, Injector injector &#41; {
	   super&#40; name, klass, innerAction&#41;;
	   this.injector = injector;
   }
   
   @Override
   public Action getAction&#40;&#41; {
	   
     Object instance = injector.getInstance&#40; actionClass &#41;;
     
     if &#40; Action.class.isAssignableFrom&#40; actionClass &#41; &#41; {
    	 
       return &#40;Action&#41; instance;
       
     } else {
    	 
       return new PojoAction&#40; instance &#41;;
       
     }
   }
 }
</pre>
		</div>
]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14171</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14171</link>
				<pubDate><![CDATA[Mon, 4 Feb 2008 09:17:53]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ Nice!

Is it in the beta jar?]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14172</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14172</link>
				<pubDate><![CDATA[Tue, 5 Feb 2008 01:36:46]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
Yes.

We are only missing now a GuiceInput, similar to SpringInput.

That's to request an object from the input and get it from Guice container. A GuiceFilter would setup the GuiceInput as the action input.]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14173</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14173</link>
				<pubDate><![CDATA[Tue, 5 Feb 2008 07:39:53]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Using Mentawai along with Guice</title>
				<description><![CDATA[ Guys, you are both insane!

ROFL =P


Sven, I like a lot your idea.  Never say something earlier because some days I'm lazy =D


VELO]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14174</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14174</link>
				<pubDate><![CDATA[Tue, 5 Feb 2008 10:33:55]]> GMT</pubDate>
				<author><![CDATA[ velo]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ @velo: Thank you! :D

<p></p>

		<cite>saoj wrote:</cite><br>
		<blockquote>
Yes.

We are only missing now a GuiceInput, similar to SpringInput.

That's to request an object from the input and get it from Guice container. A GuiceFilter would setup the GuiceInput as the action input.&nbsp;
		</blockquote>
I'm still thinking how to do it the "Guice" way... The problem is, with the name from the action input alone Guice doesn't know what kind of class to instantiate. So I believe we have to add another layer of configuration, something like this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
GuiceFilter gf = new GuiceFilter&#40;&#41;
gf.bind&#40; "myinput", MyClass.class &#41;;

addGlobalFilter&#40; gf &#41;;</pre>
		</div>
The GuiceFilter then needs to pass this configuration to the GuiceInput... I don't quite like it but I don't see another way. Do you have a better idea?]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14175</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14175</link>
				<pubDate><![CDATA[Wed, 6 Feb 2008 01:21:41]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Using Mentawai along with Guice</title>
				<description><![CDATA[ Why don't reuse current ioc method on appManager?
http://www.mentaframework.org/ioc.jsp

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
...
    public void init&#40;&#41; {
        
        // Define the IoC components...
        
        ioc&#40;"talker1", PortugueseTalker.class&#41;;
        
        ioc&#40;"talker2", PoliteTalker.class&#41;
            .addProperty&#40;"name", "Polite guy"&#41;;
            
        ioc&#40;"talker3", UnpoliteTalker.class, SESSION&#41;
            .addInitValue&#40;"Unpolite guy"&#41;;
            
    }
</pre>
		</div>]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14176</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14176</link>
				<pubDate><![CDATA[Wed, 6 Feb 2008 03:52:09]]> GMT</pubDate>
				<author><![CDATA[ velo]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
<blockquote>
The problem is, with the name from the action input alone Guice doesn't know what kind of class to instantiate.
&nbsp;
		</blockquote>

I did not know about that. So GUICE cannot instantiate by name and it needs the class as well? hummmm

Maybe using the IoC like velo suggested is a way to go. It ties a name to an implementation and also has scopes. We would have a GuiceComponent, something like that.

ioc("myclass", guice(MyClass.class));

So when you do a input.getValue("myclass"), the MyClass class will be loaded by Guice.
]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14177</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14177</link>
				<pubDate><![CDATA[Wed, 6 Feb 2008 06:14:08]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Using Mentawai along with Guice</title>
				<description><![CDATA[ Saoj...

The unique problem, today, to use Guice as the default Mentawai ioc is scope?

No workaround possible?

Maybe when can open an issue to they, when solved guice can become the default ioc on mentawai.

Or this is impossible?


VELO]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14178</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14178</link>
				<pubDate><![CDATA[Wed, 6 Feb 2008 06:19:21]]> GMT</pubDate>
				<author><![CDATA[ velo]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ 
I don't want to kill the Mentawai support for IOC. You question is non-sense. :-)

I want to add full support to Guice.

This is not a government company, where for you to become the director, the director most go away! ;-)

We can support Guice and keep the Mentawai IoC support. ]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14182</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14182</link>
				<pubDate><![CDATA[Wed, 6 Feb 2008 06:41:51]]> GMT</pubDate>
				<author><![CDATA[ saoj]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ <p></p>

		<cite>saoj wrote:</cite><br>
		<blockquote>
I did not know about that. So GUICE cannot instantiate by name and it needs the class as well? hummmm
&nbsp;
		</blockquote>
Yes! The Injector#createInstance() method only takes a class as an argument. The Injector then creates an instance of that class (or possibly a subclass if special configuration for this class has been set before).

<p></p>

		<cite>saoj wrote:</cite><br>
		<blockquote>
Maybe using the IoC like velo suggested is a way to go. It ties a name to an implementation and also has scopes. We would have a GuiceComponent, something like that.

ioc("myclass", guice(MyClass.class));

So when you do a input.getValue("myclass"), the MyClass class will be loaded by Guice.
&nbsp;
		</blockquote>

That looks good!]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14226</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14226</link>
				<pubDate><![CDATA[Thu, 7 Feb 2008 03:52:04]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ I think the ApplicationManager should be extended by this method:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>public GuiceComponent guice&#40; Class&lt;? extends Object&gt; klass,
    com.google.guice.Injector injector &#41; {
  return new GuiceComponent&#40; klass, injector &#41;;
}</pre>
		</div>
or maybe this

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>public GuiceComponent ioc&#40; String name, Class&lt;? extends Object&gt; klass, 
    com.google.guice.Injector injector &#41; { 
  GuiceComponent gc = new GuiceComponent&#40; klass, injector &#41;;
  addComponent&#40; name, gc &#41;;
  return gc;
}</pre>
		</div>
The GuiceComponent class should look like this:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>class GuiceComponent implements Component {
  private Class&lt;? extends Object&gt; klass;
  private Injector injector;

  public GuiceComponent&#40; Class&lt;? extends Object&gt; klass, Injector injector &#41; {
    this.klass = klass;
    this.injector = injector;
  }
  
  @Override
  public Object getInstance&#40;&#41; throws InstantiationException {
    return injector.getInstance&#40; klass &#41;;
  }
}</pre>
		</div>
Note: The code has not been tested! I just typed this into the forum editor :)]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14227</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14227</link>
				<pubDate><![CDATA[Thu, 7 Feb 2008 04:36:13]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
			<item>
				<title>Re:Using Mentawai along with Guice</title>
				<description><![CDATA[ What do you think, Sergio?]]></description>
				<guid isPermaLink="true">http://forum.mentaframework.org/posts/list/1795.page#14424</guid>
				<link>http://forum.mentaframework.org/posts/list/1795.page#14424</link>
				<pubDate><![CDATA[Sat, 16 Feb 2008 14:07:50]]> GMT</pubDate>
				<author><![CDATA[ Sven]]></author>
			</item>
	</channel>
</rss>