Hi,
With the recent JBoss Portal releases have run into a issue with a Hibernate extension we
created because of a the class within the Portal that explicitly references an Hibernate
implementation class rather than the standard interface. Can the following not be done via
the standard configuration file.
public class ObjectContextualizer
{
public Object context;
public ObjectContextualizer(Object context)
{
this.context = context;
}
public void attach(SessionFactory sessionFactory)
{
EventListeners listeners =
((SessionFactoryImpl)sessionFactory).getEventListeners();
PostLoadEventListener[] lels1 = listeners.getPostLoadEventListeners();
PostLoadEventListener[] lels2 = new PostLoadEventListener[lels1.length + 1];
System.arraycopy(lels1, 0, lels2, 1, lels1.length);
lels2[0] = new PostLoadEventListener()
{
public void onPostLoad(PostLoadEvent postLoadEvent)
{
Object entity = postLoadEvent.getEntity();
if (entity instanceof ContextObject)
{
ContextObject object = (ContextObject)entity;
object.setContext(context);
}
}
};
listeners.setPostLoadEventListeners(lels2);
}
}
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968628#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...