<?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/"
	>

<channel>
	<title>Technotrance, Illusions and Perspectives &#187; jboss-seam</title>
	<atom:link href="http://myblog.shriharisc.com/tag/jboss-seam/feed/" rel="self" type="application/rss+xml" />
	<link>http://myblog.shriharisc.com</link>
	<description>A dose of everyday bruises with Java/JEE</description>
	<lastBuildDate>Mon, 12 Jul 2010 17:55:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Formatting messages on JSF page in JBoss Seam</title>
		<link>http://myblog.shriharisc.com/2009/11/18/formatting-messages-on-jsf-page-in-jboss-seam/</link>
		<comments>http://myblog.shriharisc.com/2009/11/18/formatting-messages-on-jsf-page-in-jboss-seam/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 17:58:18 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[jboss-seam]]></category>

		<guid isPermaLink="false">http://myblog.shriharisc.com/?p=203</guid>
		<description><![CDATA[In many scenarios we may need to format messages on the JSF page using JBoss Seam without calling a backing bean method, One typical example could be displaying a welcome message when the user logs in to the application. This tip explores a component called Interpolator in Seam which helps us the solution. 
Lets assume [...]]]></description>
			<content:encoded><![CDATA[<p>In many scenarios we may need to format messages on the JSF page using JBoss Seam without calling a backing bean method, One typical example could be displaying a welcome message when the user logs in to the application. This tip explores a component called <a href="http://docs.jboss.org/seam/2.2.0.CR1/api/org/jboss/seam/core/Interpolator.html">Interpolator</a> in Seam which helps us the solution. </p>
<p>Lets assume we have defined a message property as welcome.message as below</p>
<pre class="brush: sql">
#different message properties
...
welcome.message= Welcome! Dear #0
...
</pre>
<p>In the homepage.xhtml (jsf page), we come populate the greeting message with, say the logged in username, using interpolator as below:</p>
<pre class="brush: xml">
   ....
   &lt;h:outputText value=&quot;#{interpolator.interpolate(messages[&#039;welcome.message&#039;],identity.username)}&quot;/&gt;
....
</pre>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/11/18/formatting-messages-on-jsf-page-in-jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to end JBoss Seam conversation in menu links?</title>
		<link>http://myblog.shriharisc.com/2009/11/17/how-to-end-jboss-seam-conversation-in-menu-links/</link>
		<comments>http://myblog.shriharisc.com/2009/11/17/how-to-end-jboss-seam-conversation-in-menu-links/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 18:23:19 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[jboss-seam]]></category>

		<guid isPermaLink="false">http://myblog.shriharisc.com/?p=199</guid>
		<description><![CDATA[Not all the times, we may be interested in using JBoss Seam&#8217;s link tag s:link to end conversation scope propagation. This holds good specifically for menu links and random hotkey navigations. One quick tip could be to specify the redirection url link with the parameter conversationPropagation=end.
]]></description>
			<content:encoded><![CDATA[<p>Not all the times, we may be interested in using JBoss Seam&#8217;s link tag <em>s:link</em> to end conversation scope propagation. This holds good specifically for menu links and random hotkey navigations. One quick tip could be to specify the redirection url link with the parameter <em>conversationPropagation=end</em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/11/17/how-to-end-jboss-seam-conversation-in-menu-links/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to change authentication success/failure message in JBoss Seam?</title>
		<link>http://myblog.shriharisc.com/2009/11/16/how-to-change-authentication-successfailure-message-in-jboss-seam/</link>
		<comments>http://myblog.shriharisc.com/2009/11/16/how-to-change-authentication-successfailure-message-in-jboss-seam/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 18:22:13 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[jboss-seam]]></category>

		<guid isPermaLink="false">http://myblog.shriharisc.com/?p=194</guid>
		<description><![CDATA[If we rely on JBoss Seam&#8217;s Security Identity Management for user authentication on a web application, we certainly think of changing the default &#8216;Welcome &#60;username&#62;&#8217; to something different and catchy. This particular tip explores such a possibility successfully in 2-3 steps:
1)  Assuming that you have defined the security identity and core resource loader components have [...]]]></description>
			<content:encoded><![CDATA[<p>If we rely on JBoss Seam&#8217;s Security Identity Management for user authentication on a web application, we certainly think of changing the default &#8216;Welcome &lt;username&gt;&#8217; to something different and catchy. This particular tip explores such a possibility successfully in 2-3 steps:</p>
<p>1)  Assuming that you have defined the security identity and core resource loader components have been defined in WEB-INF/components.xml as below, we have to modify the properties myapplication_en.properties (_en is the default locale)</p>
<pre class="brush: xml">
&lt;security:identity authenticate-method=&quot;#{authenticator.authenticate}&quot; remember-me=&quot;true&quot;/&gt;
&lt;core:resource-loader bundle-names=&quot;myapplication&quot;/&gt;
</pre>
<p>define your custom message like this, where #0 is a parameter placeholder.</p>
<pre class="brush: plain">
welcome.message=Good to see you, #0
loginfailed.message=Unable to login mate, please check your credentials!
</pre>
<p>2) Modify your authenticator component to add custom message if login/authentication is successful.</p>
<pre class="brush: java">
public boolean authenticate()
{  User loggedInUser = authenticationservice.autheticate(credentials.getUsername(), credentials.getPassword());
   FacesMessages messages = FacesMessages.instance();
    if(loggedInUser==null)
    {    messages.addFromResourceBundle(&quot;loginfailed.message&quot;, null);
         return false;
    }
    messages.addFromResourceBundle(&quot;welcome.message&quot;, loggedInUser.getFullname());
    return true;
}
</pre>
<p>Are we done?  wait&#8230; We need to reset the earlier messages (the default ones)</p>
<p>3) Add two more entries to myapplication_en.properties and set these properties as blank. This would reset the existing default ones.</p>
<pre class="brush: plain">
org.jboss.seam.loginSuccessful=
org.jboss.seam.loginFailed=
</pre>
<p>Aint it easy and cool!</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/11/16/how-to-change-authentication-successfailure-message-in-jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integrating Hibernate Search on PrimeFaces using Google Guice and JBoss Seam</title>
		<link>http://myblog.shriharisc.com/2009/11/14/integrating-hibernate-search-on-primefaces-using-google-guice-and-jboss-seam/</link>
		<comments>http://myblog.shriharisc.com/2009/11/14/integrating-hibernate-search-on-primefaces-using-google-guice-and-jboss-seam/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 18:58:27 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[google-guice]]></category>
		<category><![CDATA[hibernate-search]]></category>
		<category><![CDATA[jboss-seam]]></category>
		<category><![CDATA[primefaces]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=133</guid>
		<description><![CDATA[Recently I have been working on an application involving PrimeFaces and required search capabilities directly on the persisted data. Though I can use Hibernate search for implementing search services, the Google Guice, the underlying IoC framework, which PrimeFaces provide does not provide me the out-of-the-box integration. I am extending from my previous blog post which [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have been working on an application involving <a href="http://primefaces.prime.com.tr/en/">PrimeFaces</a> and required search capabilities directly on the persisted data. Though I can use Hibernate search for implementing search services, the Google Guice, the underlying IoC framework, which PrimeFaces provide does not provide me the out-of-the-box integration. I am extending from my <a href="http://myblog.shriharisc.com/2009/07/31/injecting-entitymanager-in-google-guice-through-jboss-seam/">previous blog post</a> which talked about using Google Guice to inject JPA EntityManager. This post builds on the previous post and explores the option of search. Here are the following sequence of steps I followed to ensure PrimeFaces widgets are Hibernate Search compliant:</p>
<p>1)  Follow the steps mentioned to get an EntityManager instance fro m JBoss Seam&#8217;s component xml and register in the Google Guice injector using a Provider  implementation. Make a little change where the Provider&#8217;s getter method is made static.  Following is the EntityManagerProvider code snippet to do that:</p>
<pre class="brush: java">
class EntityManagerProvider implements Provider
{       static EntityManagerFactory entityManagerFactory = null;
        public static EntityManager get()
        {   return entityManagerFactory.createEntityManager();
        }
}
</pre>
<p>2) Implement Guice injection Provider for constructing a FullTextEntityManager from EntityManager</p>
<pre class="brush: java">
public class FullTextEntityManagerProvider implements Provider
{    static FullTextEntityManager fullTextManager = null;
     private static EntityManager entityManager;

     public static void setEntityManager(EntityManager em)
     {   entityManager = em;
     }

      public FullTextEntityManager get()
      {   if(fullTextManager==null)
             fullTextManager = Search.getFullTextEntityManager(entityManager);
           return fullTextManager;
      }
}
</pre>
<p>3) Modify the custom module (now refactored as MySearchEntityManagerModule) to construct the FullTextEntityManager using EntityManager instance as shown below.</p>
<pre class="brush: java">
public class MySearchEntityManagerModule extends AbstractModule
{      public void configure()
       {   Expressions expressions = Expressions.instance();
           ValueExpression emfVE = expressions.createValueExpression(&quot;#{my_persistence_unit}&quot;);
           EntityManagerFactory emf = (EntityManagerFactory)emfVE.getValue();
           EntityManagerProvider.setEntityManagerFactory(emf);
           FullTextEntityManagerProvider.setEntityManager(provider.get());

            //bind EntityManager and FullTextEntityManager for both pure database and search specific integration
            bind(EntityManager.class).toProvider(EntityManagerProvider.class).in(Scopes.SINGLETON);
            bind(FullTextEntityManager.class).toProvider(FullTextEntityManagerProvider.class).in(Scopes.SINGLETON);
     }
}
</pre>
<p>3) Inject the FullTextEntityManager in the dataservice (DAO) for searching for text tokens using Hibernate Search.</p>
<pre class="brush: java">
@Name(&quot;hybrid&quot;)
@Guice
public class HybridDAO
{  @Inject FullTextEntityManager searchManager;
    //other DAO methods to perform search using Hibernate Search and Lucene
}
</pre>
<p>This quick tip provides us a capability of enhancing Primefaces widgets to use the power of Hibernate Search for search and much more extensible features.</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/11/14/integrating-hibernate-search-on-primefaces-using-google-guice-and-jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Context specific Outjection modes in JBoss Seam</title>
		<link>http://myblog.shriharisc.com/2009/11/13/context-specific-outjection-modes-in-jboss-seam/</link>
		<comments>http://myblog.shriharisc.com/2009/11/13/context-specific-outjection-modes-in-jboss-seam/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 19:07:38 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[jboss-seam]]></category>

		<guid isPermaLink="false">http://myblog.shriharisc.com/?p=161</guid>
		<description><![CDATA[There are 7 types of contexts available in JBoss Seam. In order to outject (make an instantiated/ populated object available to other components participating in the same context) for a particular scope, say CONVERSATION, there are at least 2 ways of outjecting an instance as follows:
1) Declaratively : This could be used when there are [...]]]></description>
			<content:encoded><![CDATA[<p>There are 7 types of contexts available in JBoss Seam. In order to outject (make an instantiated/ populated object available to other components participating in the same context) for a particular scope, say CONVERSATION, there are at least 2 ways of outjecting an instance as follows:</p>
<p>1) <strong>Declaratively</strong> : This could be used when there are component boundaries clearly demarcated and the instance needs to available for a longer running conversation. An example snippet is given below:</p>
<pre class="brush: java">
@Name(&quot;producer&quot;)
public class Producer
{   @Out(scope=ScopeType.CONVERSATION)
      private QueueFeed feed;

      //methods to produce and populate the feed
      @Begin public void doStart(){}
      @End public void close(){}
}
</pre>
<pre class="brush: java">
@Name(&quot;consumer&quot;)
public class Consumer
{   @In  private QueueFeed feed;
       //methods to consume and cleanup the feed
}
</pre>
<p>2) <strong>Programmaticaly</strong> : This approach is used when one would want place the instance in the already established context, and other seam components just reference the instance and used as given below:</p>
<pre class="brush: java">
@Name(&quot;producer&quot;)
public class Producer
{   public void produceIntermediate()
    {   QueueFeed queueFeed;
         //populate queueFeed
        Contexts.getConversationContext().set(&quot;queueFeed&quot;, queueFeed);
     }
}
</pre>
<pre class="brush: java">
@Name(&quot;consumer&quot;)
public class Consumer
{  public void consumeIntermediate()
    {   QueueFeed queueFeed = (QueueFeed) ( Contexts.getConversationContext().get(&quot;queueFeed&quot;,));
     }
}
</pre>
<p>This way one can manage scopes effectively with regard to instance usage across participating components</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/11/13/context-specific-outjection-modes-in-jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Forking navigations based on user roles in JBoss Seam using Seam-Security</title>
		<link>http://myblog.shriharisc.com/2009/10/14/forking-navigations-based-on-user-roles-in-jboss-seam-using-seam-security/</link>
		<comments>http://myblog.shriharisc.com/2009/10/14/forking-navigations-based-on-user-roles-in-jboss-seam-using-seam-security/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 10:19:27 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[jboss-seam]]></category>
		<category><![CDATA[seam-security]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=130</guid>
		<description><![CDATA[This particular tip on loading different homepages for the role associated for a specific logged in user for a JSF web application written using JBoss Seam and identity management using Seam-Security. This tip assumes that a single user will be associated with a single role.
Assume we need to develop a course management JSF application which [...]]]></description>
			<content:encoded><![CDATA[<p>This particular tip on loading different homepages for the role associated for a specific logged in user for a JSF web application written using JBoss Seam and identity management using Seam-Security. This tip assumes that a single user will be associated with a single role.</p>
<p>Assume we need to develop a course management JSF application which supports users of 2 different roles : teacher and student. This means if a user with teacher role logs in teacher specific homepage should come  and student logging in should display student homepage. The following are steps to achieve this requirement.</p>
<p>1) Change WEB-INF/components.xml to include the seam-security authentication patterns</p>
<pre class="brush: xml">
  &lt;components xmlns=&quot;http://jboss.com/products/seam/components&quot;
          ....
          xmlns:security=&quot;http://jboss.com/products/seam/security&quot;
          xsi:schemaLocation=&quot;http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.0.xsd
                ....
          &quot;&gt;
 ...
 &lt;security:identity authenticate-method=&quot;#{authenticator.authenticate}&quot;/&gt;
&lt;/components&gt;
</pre>
<p>2) Define an Authenticator action class with JBoss Seam component name &#8220;authenticator&#8221; and define an authenticate method inside</p>
<pre class="brush: java">
@Name(&quot;authenticator&quot;)
public class AuthenticatorAction
{   @In
    private Identity identity;
    @In(create=true)
    private AuthService service;

    ...
    @SuppressWarnings(&quot;deprecated&quot;)
    public boolean authenticate()
    {   String username = identity.getUsername();
        String password = identity.getPassword();
        if(username==null || password==null)
           return false;
        //authenticate the user from database
        User user = service.authenticate(username,password);
        // check user validity.
        identity.addRole(user.getRole());
        return true;
    }
}
</pre>
<p>3) Define the login portal widget in the login-page (say login.xhtml)</p>
<pre class="brush: xml">
&lt;ui:composition xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 .....
   &lt;h:panelGrid columns=&quot;2&quot; style=&quot;width:27px&quot;&gt;
      &lt;h:outputText value=&quot;Username: &quot;/&gt;
      &lt;h:inputText id=&quot;username&quot; value=&quot;#{identity.username}&quot; rows=&quot;1&quot; cols=&quot;12&quot;&gt;
         &lt;f:validateLength minimum=&quot;8&quot;  /&gt;
      &lt;/h:inputText&gt;
      &lt;h:outputText value=&quot;Password:&quot; rows=&quot;1&quot; cols=&quot;12&quot;/&gt;
      &lt;h:inputSecret id=&quot;password&quot; value=&quot;#{identity.password}&quot; /&gt;
   &lt;/h:panelGrid&gt;
   &lt;h:commandButton id=&quot;login&quot; action=&quot;#{identity.login}&quot; value=&quot;Login&quot;/&gt;
    ...
 &lt;/ui:composition&gt;
</pre>
<p>4) Wire the action outcomes to set up the navigation paths in WEB-INF/pages.xml</p>
<pre class="brush: xml">
&lt;pages xmlns=&quot;http://jboss.com/products/seam/pages&quot;
       ....
       no-conversation-view-id=&quot;/index.html&quot;&gt;

     &lt;page view-id=&quot;/login.xhtml&quot;&gt;
        &lt;navigation from-action=&quot;#{authenticator.checkLogin}&quot;&gt;
           &lt;rule if=&quot;#{identity.loggedIn and identity.role==&#039;Teacher&#039;}&quot;&gt;
               &lt;redirect view-id=&quot;/teacher/homepage.xhtml&quot; /&gt;
          &lt;/rule&gt;
       &lt;/navigation&gt;
       &lt;navigation from-action=&quot;#{identity.login}&quot;&gt;
           &lt;rule if=&quot;#{identity.loggedIn and identity.hasRole(&#039;Teacher&#039;)}&quot;&gt;
              &lt;redirect view-id=&quot;/teacher/homepage.xhtml&quot; /&gt;
          &lt;/rule&gt;
       &lt;/navigation&gt;
       &lt;navigation from-action=&quot;#{authenticator.checkLogin}&quot;&gt;
          &lt;rule if=&quot;#{identity.loggedIn and identity.role==&#039;Student&#039;}&quot;&gt;
               &lt;redirect view-id=&quot;/student/homepage.xhtml&quot; /&gt;
          &lt;/rule&gt;
       &lt;/navigation&gt;
       &lt;navigation from-action=&quot;#{identity.login}&quot;&gt;
           &lt;rule if=&quot;#{identity.loggedIn and identity.hasRole(&#039;Student&#039;)}&quot;&gt;
              &lt;redirect view-id=&quot;/student/homepage.xhtml&quot; /&gt;
          &lt;/rule&gt;
       &lt;/navigation&gt;
    &lt;/page&gt;
    ....
   &lt;exception&gt;
        &lt;redirect view-id=&quot;/index.xhtml&quot;&gt;
           &lt;message&gt;Please log in first&lt;/message&gt;
        &lt;/redirect&gt;
   &lt;/exception&gt;
&lt;/pages&gt;
</pre>
<p>You can extend this tip to come out of different other user-role combinations.</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/10/14/forking-navigations-based-on-user-roles-in-jboss-seam-using-seam-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Injecting JPA EntityManager in Google Guice through JBoss Seam</title>
		<link>http://myblog.shriharisc.com/2009/07/31/injecting-entitymanager-in-google-guice-through-jboss-seam/</link>
		<comments>http://myblog.shriharisc.com/2009/07/31/injecting-entitymanager-in-google-guice-through-jboss-seam/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 18:17:44 +0000</pubDate>
		<dc:creator>Shrihari</dc:creator>
				<category><![CDATA[jee-light]]></category>
		<category><![CDATA[google-guice]]></category>
		<category><![CDATA[jboss-seam]]></category>
		<category><![CDATA[jpa]]></category>

		<guid isPermaLink="false">http://schakrap.wordpress.com/?p=87</guid>
		<description><![CDATA[This cool tip describes a 3 step process to use JPA&#8217;s EntityManager initialized in JBoss Seam inside the Google Guice environment.
1). Define Seam&#8217;s components.xml with entity-manager-factory component as below

&#60;components&#62;
    &#60;persistence:entity-manager-factory name=&#34;my_persistence_unit&#34;/&#62;
    &#60;guice:init injector=&#34;#{myInjector}&#34;/&#62;
    &#60;guice:injector name=&#34;myInjector&#34;&#62;
        &#60;guice:modules&#62;
    [...]]]></description>
			<content:encoded><![CDATA[<p>This cool tip describes a 3 step process to use JPA&#8217;s EntityManager initialized in JBoss Seam inside the Google Guice environment.</p>
<p>1). Define Seam&#8217;s components.xml with entity-manager-factory component as below</p>
<pre class="brush: xml">
&lt;components&gt;
    &lt;persistence:entity-manager-factory name=&quot;my_persistence_unit&quot;/&gt;
    &lt;guice:init injector=&quot;#{myInjector}&quot;/&gt;
    &lt;guice:injector name=&quot;myInjector&quot;&gt;
        &lt;guice:modules&gt;
           &lt;value&gt;mypackage.MyEntityManagerModule&lt;/value&gt;
        &lt;/guice:modules&gt;
    &lt;/guice:injector&gt;
&lt;/components&gt;</pre>
<p>where my_persistence_unit is the persistence unit name under META-INF/persistence.xml.</p>
<p>2).   Define a Google Guice Module to wire-up Seam&#8217;s EnitiyManagerFactory by looking-up based on the expression-value and binding it to Guice context using a Provider</p>
<pre class="brush: java">
public class MyEntityManagerModule extends AbstractModule
{   public void configure()
    {   Expressions expressions = Expressions.instance();
        ValueExpression emfVE = expressions.createValueExpression(&quot;#{my_persistence_unit}&quot;);
        EntityManagerFactory emf = (EntityManagerFactory)emfVE.getValue();
        EntityManagerProvider.setEntityManagerFactory(emf);
        bind(EntityManager.class).toProvider(EntityManagerProvider.class).in(Scopes.SINGLETON);
     }
 }
 </pre>
<pre class="brush: java">
class EntityManagerProvider implements Provider
    {   static EntityManagerFactory entityManagerFactory = null;
        public EntityManager get()
        {   return entityManagerFactory.createEntityManager();
        }
    }
 </pre>
<p>3)   One could use the EntityManager anywhere in the Seam-Guice hybrid component:</p>
<pre class="brush: java">
@Name(&quot;hybrid&quot;)
@Guice
public class HybridDAO
{  @Inject EntityManager entityManager;
   //other DAO methods.
}
</pre>
<p>This makes Guice components use EntityManager normally use Seam established EntityManagerFactory</p>
]]></content:encoded>
			<wfw:commentRss>http://myblog.shriharisc.com/2009/07/31/injecting-entitymanager-in-google-guice-through-jboss-seam/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
