Seam SVN: r9698 - trunk.
by seam-commits@lists.jboss.org
Author: jbalunas(a)redhat.com
Date: 2008-12-02 10:35:28 -0500 (Tue, 02 Dec 2008)
New Revision: 9698
Modified:
trunk/release-process.txt
Log:
updated to include seam-gen validation
Modified: trunk/release-process.txt
===================================================================
--- trunk/release-process.txt 2008-12-02 15:26:59 UTC (rev 9697)
+++ trunk/release-process.txt 2008-12-02 15:35:28 UTC (rev 9698)
@@ -1,8 +1,6 @@
Seam Release Process
====================
-<TODO: update for 2.1.X releases during 2.1.0.B1 release/>
-
Notify branch is closed
------------------------
* Send an email to seam-dev(a)lists.jboss.org.
@@ -300,6 +298,7 @@
- run "seam new-action new-form restart"
- test both generated pages
- run seam test
+ - run "ant validate" in seam-gen project directory
* seam-gen IceFaces EAR test
- run seam with setup create-project and explode
- during setup choose to use icefaces
@@ -308,6 +307,7 @@
- run seam generate-entities restart
- test the basic functionality of the app (CRUD on each table)
- run seam test
+ - run "ant validate" in seam-gen project directory
* seam-gen WAR
- run seam with setup create-project and explode
- during setup choose a WAR project
@@ -317,6 +317,7 @@
- run "seam new-action new-form restart"
- test both generated pages
- run seam test
+ - run "ant validate" in seam-gen project directory
* JBDS - import the EAR seam-gen generated project into JBDS.
- Enable Seam support in project properties
- Check that EL code completion works for Seam components
16 years
Seam SVN: r9697 - trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2008-12-02 10:26:59 -0500 (Tue, 02 Dec 2008)
New Revision: 9697
Modified:
trunk/build.xml
Log:
JBSEAM-3725
Modified: trunk/build.xml
===================================================================
--- trunk/build.xml 2008-12-02 12:05:50 UTC (rev 9696)
+++ trunk/build.xml 2008-12-02 15:26:59 UTC (rev 9697)
@@ -598,6 +598,12 @@
<include name="**/*.jar" />
</fileset>
</copy>
+
+ <copy todir="${dist.src.test.dir}">
+ <fileset dir="${src.test.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ </copy>
</target>
16 years
Seam SVN: r9696 - trunk/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-12-02 07:05:50 -0500 (Tue, 02 Dec 2008)
New Revision: 9696
Modified:
trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
looks like i broke a few things.. reverting for now
Modified: trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,7 +1,6 @@
package org.jboss.seam.persistence;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -110,10 +109,8 @@
* Wrap the entityManager before returning it to the application
*/
public EntityManager proxyEntityManager(EntityManager entityManager)
- {
- return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
- new Class[] {EntityManager.class},
- new EntityManagerProxy(entityManager));
+ {
+ return new EntityManagerProxy(entityManager);
}
/**
Modified: trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -3,30 +3,70 @@
import java.io.Serializable;
import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+import javax.persistence.FlushModeType;
+import javax.persistence.LockModeType;
import javax.persistence.Query;
import org.jboss.seam.security.permission.PermissionManager;
-import org.jboss.seam.util.DelegatingInvocationHandler;
/**
- * Proxies the EntityManager, and implements EL interpolation in JPA-QL
+ * Proxies the EntityManager, and implements EL interpolation
+ * in JPA-QL
*
* @author Gavin King
- * @author Shane Bryzak
+ *
*/
-public class EntityManagerProxy extends DelegatingInvocationHandler<EntityManager> implements Serializable
+public class EntityManagerProxy implements EntityManager, Serializable
{
+ private EntityManager delegate;
+
public EntityManagerProxy(EntityManager entityManager)
{
- super(entityManager);
+ delegate = entityManager;
}
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public void close()
+ {
+ delegate.close();
+ }
+
+ public boolean contains(Object entity)
+ {
+ return delegate.contains(entity);
+ }
+
+ public Query createNamedQuery(String name)
+ {
+ return delegate.createNamedQuery(name);
+ }
+
+ public Query createNativeQuery(String sql, Class clazz)
+ {
+ return delegate.createNativeQuery(sql, clazz);
+ }
+
+ public Query createNativeQuery(String sql, String lang)
+ {
+ return delegate.createNativeQuery(sql, lang);
+ }
+
+ public Query createNativeQuery(String sql)
+ {
+ return delegate.createNativeQuery(sql);
+ }
+
public Query createQuery(String ejbql)
{
if ( ejbql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(ejbql);
- Query query = super.getDelegate().createQuery( qp.getEjbql() );
+ Query query = delegate.createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -38,19 +78,78 @@
}
else
{
- return super.getDelegate().createQuery(ejbql);
+ return delegate.createQuery(ejbql);
}
}
- /* public Object getDelegate()
+ public <T> T find(Class<T> clazz, Object id)
{
- return PersistenceProvider.instance().proxyDelegate( super.getDelegate().getDelegate() );
- }*/
+ return delegate.find(clazz, id);
+ }
+ public void flush()
+ {
+ delegate.flush();
+ }
+ public Object getDelegate()
+ {
+ return PersistenceProvider.instance().proxyDelegate( delegate.getDelegate() );
+ }
+
+ public FlushModeType getFlushMode()
+ {
+ return delegate.getFlushMode();
+ }
+
+ public <T> T getReference(Class<T> clazz, Object id)
+ {
+ return delegate.getReference(clazz, id);
+ }
+
+ public EntityTransaction getTransaction()
+ {
+ return delegate.getTransaction();
+ }
+
+ public boolean isOpen()
+ {
+ return delegate.isOpen();
+ }
+
+ public void joinTransaction()
+ {
+ delegate.joinTransaction();
+ }
+
+ public void lock(Object entity, LockModeType lm)
+ {
+ delegate.lock(entity, lm);
+ }
+
+ public <T> T merge(T entity)
+ {
+ return delegate.merge(entity);
+ }
+
+ public void persist(Object entity)
+ {
+ delegate.persist(entity);
+ }
+
+ public void refresh(Object entity)
+ {
+ delegate.refresh(entity);
+ }
+
public void remove(Object entity)
{
- super.getDelegate().remove(entity);
+ delegate.remove(entity);
PermissionManager.instance().clearPermissions(entity);
}
+
+ public void setFlushMode(FlushModeType fm)
+ {
+ delegate.setFlushMode(fm);
+ }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,19 +1,50 @@
//$Id$
package org.jboss.seam.persistence;
+import java.io.Serializable;
+
+import org.apache.lucene.search.Query;
+import org.hibernate.search.SearchFactory;
import org.hibernate.search.jpa.FullTextEntityManager;
-import org.jboss.seam.util.DelegatingInvocationHandler;
+import org.hibernate.search.jpa.FullTextQuery;
/**
* Wrap a FullTextEntityManager
*
* @author Emmanuel Bernard
- * @author Shane Bryzak
*/
-public class FullTextEntityManagerProxy extends DelegatingInvocationHandler<FullTextEntityManager>
+public class FullTextEntityManagerProxy extends EntityManagerProxy implements FullTextEntityManager
{
+ private FullTextEntityManager fullTextEntityManager;
+
public FullTextEntityManagerProxy(FullTextEntityManager entityManager)
{
super(entityManager);
+ this.fullTextEntityManager = entityManager;
}
+
+ public FullTextQuery createFullTextQuery(Query query, Class... classes)
+ {
+ return fullTextEntityManager.createFullTextQuery(query, classes);
+ }
+
+ public void index(Object object)
+ {
+ fullTextEntityManager.index(object);
+ }
+
+ public SearchFactory getSearchFactory()
+ {
+ return fullTextEntityManager.getSearchFactory();
+ }
+
+ public void purge(Class aClass, Serializable serializable)
+ {
+ fullTextEntityManager.purge(aClass, serializable);
+ }
+
+ public void purgeAll(Class aClass)
+ {
+ fullTextEntityManager.purgeAll(aClass);
+ }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,20 +1,168 @@
package org.jboss.seam.persistence;
+import java.io.Serializable;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+
+import org.hibernate.HibernateException;
+import org.hibernate.Query;
+import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
-import org.jboss.seam.util.DelegatingInvocationHandler;
+import org.hibernate.search.SearchFactory;
+import org.hibernate.type.Type;
/**
* Wraps a Hibernate Search session
*
* @author Gavin King
- * @author Shane Bryzak
*
*/
@SuppressWarnings("deprecation")
-public class FullTextHibernateSessionProxy extends DelegatingInvocationHandler<FullTextSession>
-{
+public class FullTextHibernateSessionProxy extends HibernateSessionProxy implements FullTextSession
+{
+ private FullTextSession fullTextSession;
+
public FullTextHibernateSessionProxy(FullTextSession fullTextSession)
{
super(fullTextSession);
+ this.fullTextSession = fullTextSession;
}
+
+ public void index(Object arg0)
+ {
+ fullTextSession.index(arg0);
+ }
+
+ public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query arg0, Class... arg1)
+ {
+ return fullTextSession.createFullTextQuery(arg0, arg1);
+ }
+
+ public Query createSQLQuery(String arg0, String arg1, Class arg2)
+ {
+ return fullTextSession.createSQLQuery(arg0, arg1, arg2);
+ }
+
+ public Query createSQLQuery(String arg0, String[] arg1, Class[] arg2)
+ {
+ return fullTextSession.createSQLQuery(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.delete(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.delete(arg0, arg1, arg2);
+ }
+
+ public int delete(String arg0) throws HibernateException
+ {
+ return fullTextSession.delete(arg0);
+ }
+
+ public Collection filter(Object arg0, String arg1, Object arg2, Type arg3) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1, arg2, arg3);
+ }
+
+ public Collection filter(Object arg0, String arg1, Object[] arg2, Type[] arg3) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1, arg2, arg3);
+ }
+
+ public Collection filter(Object arg0, String arg1) throws HibernateException
+ {
+ return fullTextSession.filter(arg0, arg1);
+ }
+
+ public List find(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.find(arg0, arg1, arg2);
+ }
+
+ public List find(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.find(arg0, arg1, arg2);
+ }
+
+ public List find(String arg0) throws HibernateException
+ {
+ return fullTextSession.find(arg0);
+ }
+
+
+ public SearchFactory getSearchFactory()
+ {
+ return fullTextSession.getSearchFactory();
+ }
+
+ public void purge(Class aClass, Serializable serializable)
+ {
+ fullTextSession.purge(aClass, serializable);
+ }
+
+ public void purgeAll(Class aClass)
+ {
+ fullTextSession.purgeAll(aClass);
+ }
+
+ public Iterator iterate(String arg0, Object arg1, Type arg2) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0, arg1, arg2);
+ }
+
+ public Iterator iterate(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0, arg1, arg2);
+ }
+
+ public Iterator iterate(String arg0) throws HibernateException
+ {
+ return fullTextSession.iterate(arg0);
+ }
+
+ public void save(Object arg0, Serializable arg1) throws HibernateException
+ {
+ fullTextSession.save(arg0, arg1);
+ }
+
+ public void save(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ fullTextSession.save(arg0, arg1, arg2);
+ }
+
+ public Object saveOrUpdateCopy(Object arg0, Serializable arg1) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1);
+ }
+
+ public Object saveOrUpdateCopy(Object arg0) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0);
+ }
+
+ public Object saveOrUpdateCopy(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1, arg2);
+ }
+
+ public Object saveOrUpdateCopy(String arg0, Object arg1) throws HibernateException
+ {
+ return fullTextSession.saveOrUpdateCopy(arg0, arg1);
+ }
+
+ public void update(Object arg0, Serializable arg1) throws HibernateException
+ {
+ fullTextSession.update(arg0, arg1);
+ }
+
+ public void update(String arg0, Object arg1, Serializable arg2) throws HibernateException
+ {
+ fullTextSession.update(arg0, arg1, arg2);
+ }
+
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -4,7 +4,6 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Map;
@@ -17,7 +16,6 @@
import org.hibernate.Session;
import org.hibernate.StaleStateException;
import org.hibernate.TransientObjectException;
-import org.hibernate.engine.SessionImplementor;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.type.VersionType;
@@ -95,9 +93,7 @@
{
if (FULL_TEXT_SESSION_PROXY_CONSTRUCTOR==null)
{
- return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
- new Class[] {Session.class, SessionImplementor.class},
- new HibernateSessionProxy(session));
+ return new HibernateSessionProxy(session);
}
else
{
@@ -106,9 +102,7 @@
}
catch(Exception e) {
log.warn("Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned", e);
- return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
- new Class[] {Session.class, SessionImplementor.class},
- new HibernateSessionProxy(session));
+ return new HibernateSessionProxy(session);
}
}
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -1,26 +1,36 @@
package org.jboss.seam.persistence;
import java.io.Serializable;
+import java.sql.Connection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.hibernate.CacheMode;
+import org.hibernate.Criteria;
+import org.hibernate.EntityMode;
+import org.hibernate.Filter;
+import org.hibernate.FlushMode;
import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
+import org.hibernate.LockMode;
import org.hibernate.Query;
+import org.hibernate.ReplicationMode;
+import org.hibernate.SQLQuery;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
+import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.collection.PersistentCollection;
-import org.hibernate.engine.ActionQueue;
-import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.PersistenceContext;
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
+import org.hibernate.engine.ActionQueue;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
import org.hibernate.event.EventListeners;
import org.hibernate.event.EventSource;
@@ -29,8 +39,8 @@
import org.hibernate.jdbc.JDBCContext;
import org.hibernate.loader.custom.CustomQuery;
import org.hibernate.persister.entity.EntityPersister;
+import org.hibernate.stat.SessionStatistics;
import org.hibernate.type.Type;
-import org.jboss.seam.util.DelegatingInvocationHandler;
/**
* Proxies the Session, and implements EL interpolation
@@ -39,25 +49,83 @@
*
* @author Gavin King
* @author Emmanuel Bernard
- * @author Shane Bryzak
+ * FIXME: EventSource should not really be there, remove once HSearch is fixed
*
*/
-public class HibernateSessionProxy extends DelegatingInvocationHandler<Session>
-{
+public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
+{
+ private Session delegate;
+
/**
* Don't use that constructor directly, use HibernatePersistenceProvider.proxySession()
*/
public HibernateSessionProxy(Session session)
{
- super(session);
- }
+ delegate = session;
+ }
+ public Transaction beginTransaction() throws HibernateException
+ {
+ return delegate.beginTransaction();
+ }
+
+ public void cancelQuery() throws HibernateException
+ {
+ delegate.cancelQuery();
+ }
+
+ public void clear()
+ {
+ delegate.clear();
+ }
+
+ public Connection close() throws HibernateException
+ {
+ return delegate.close();
+ }
+
+ @SuppressWarnings("deprecation")
+ public Connection connection() throws HibernateException
+ {
+ return delegate.connection();
+ }
+
+ public boolean contains(Object arg0)
+ {
+ return delegate.contains(arg0);
+ }
+
+ public Criteria createCriteria(Class arg0, String arg1)
+ {
+ return delegate.createCriteria(arg0, arg1);
+ }
+
+ public Criteria createCriteria(Class arg0)
+ {
+ return delegate.createCriteria(arg0);
+ }
+
+ public Criteria createCriteria(String arg0, String arg1)
+ {
+ return delegate.createCriteria(arg0, arg1);
+ }
+
+ public Criteria createCriteria(String arg0)
+ {
+ return delegate.createCriteria(arg0);
+ }
+
+ public Query createFilter(Object arg0, String arg1) throws HibernateException
+ {
+ return delegate.createFilter(arg0, arg1);
+ }
+
public Query createQuery(String hql) throws HibernateException
{
if ( hql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(hql);
- Query query = getDelegate().createQuery( qp.getEjbql() );
+ Query query = delegate.createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -69,23 +137,283 @@
}
else
{
- return getDelegate().createQuery(hql);
+ return delegate.createQuery(hql);
}
}
+ public SQLQuery createSQLQuery(String arg0) throws HibernateException
+ {
+ return delegate.createSQLQuery(arg0);
+ }
+
+ public void delete(Object arg0) throws HibernateException
+ {
+ delegate.delete(arg0);
+ }
+
+ public void delete(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.delete(arg0, arg1);
+ }
+
+ public void disableFilter(String arg0)
+ {
+ delegate.disableFilter(arg0);
+ }
+
+ public Connection disconnect() throws HibernateException
+ {
+ return delegate.disconnect();
+ }
+
+ public Filter enableFilter(String arg0)
+ {
+ return delegate.enableFilter(arg0);
+ }
+
+ public void evict(Object arg0) throws HibernateException
+ {
+ delegate.evict(arg0);
+ }
+
+ public void flush() throws HibernateException
+ {
+ delegate.flush();
+ }
+
+ public Object get(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.get(arg0, arg1, arg2);
+ }
+
+ public Object get(Class arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.get(arg0, arg1);
+ }
+
+ public Object get(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.get(arg0, arg1, arg2);
+ }
+
+ public Object get(String arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.get(arg0, arg1);
+ }
+
+ public CacheMode getCacheMode()
+ {
+ return delegate.getCacheMode();
+ }
+
+ public LockMode getCurrentLockMode(Object arg0) throws HibernateException
+ {
+ return delegate.getCurrentLockMode(arg0);
+ }
+
+ public Filter getEnabledFilter(String arg0)
+ {
+ return delegate.getEnabledFilter(arg0);
+ }
+
+ public EntityMode getEntityMode()
+ {
+ return delegate.getEntityMode();
+ }
+
+ public String getEntityName(Object arg0) throws HibernateException
+ {
+ return delegate.getEntityName(arg0);
+ }
+
+ public FlushMode getFlushMode()
+ {
+ return delegate.getFlushMode();
+ }
+
+ public Serializable getIdentifier(Object arg0) throws HibernateException
+ {
+ return delegate.getIdentifier(arg0);
+ }
+
+ public Query getNamedQuery(String arg0) throws HibernateException
+ {
+ return delegate.getNamedQuery(arg0);
+ }
+
+ public Session getSession(EntityMode arg0)
+ {
+ return delegate.getSession(arg0);
+ }
+
+ public SessionFactory getSessionFactory()
+ {
+ return delegate.getSessionFactory();
+ }
+
+ public SessionStatistics getStatistics()
+ {
+ return delegate.getStatistics();
+ }
+
+ public Transaction getTransaction()
+ {
+ return delegate.getTransaction();
+ }
+
+ public boolean isConnected()
+ {
+ return delegate.isConnected();
+ }
+
+ public boolean isDirty() throws HibernateException
+ {
+ return delegate.isDirty();
+ }
+
+ public boolean isOpen()
+ {
+ return delegate.isOpen();
+ }
+
+ public Object load(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.load(arg0, arg1, arg2);
+ }
+
+ public Object load(Class arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.load(arg0, arg1);
+ }
+
+ public void load(Object arg0, Serializable arg1) throws HibernateException
+ {
+ delegate.load(arg0, arg1);
+ }
+
+ public Object load(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
+ {
+ return delegate.load(arg0, arg1, arg2);
+ }
+
+ public Object load(String arg0, Serializable arg1) throws HibernateException
+ {
+ return delegate.load(arg0, arg1);
+ }
+
+ public void lock(Object arg0, LockMode arg1) throws HibernateException
+ {
+ delegate.lock(arg0, arg1);
+ }
+
+ public void lock(String arg0, Object arg1, LockMode arg2) throws HibernateException
+ {
+ delegate.lock(arg0, arg1, arg2);
+ }
+
+ public Object merge(Object arg0) throws HibernateException
+ {
+ return delegate.merge(arg0);
+ }
+
+ public Object merge(String arg0, Object arg1) throws HibernateException
+ {
+ return delegate.merge(arg0, arg1);
+ }
+
+ public void persist(Object arg0) throws HibernateException
+ {
+ delegate.persist(arg0);
+ }
+
+ public void persist(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.persist(arg0, arg1);
+ }
+
public void reconnect() throws HibernateException
{
throw new UnsupportedOperationException("deprecated");
}
+
+ public void reconnect(Connection arg0) throws HibernateException
+ {
+ delegate.reconnect(arg0);
+ }
+
+ public void refresh(Object arg0, LockMode arg1) throws HibernateException
+ {
+ delegate.refresh(arg0, arg1);
+ }
+
+ public void refresh(Object arg0) throws HibernateException
+ {
+ delegate.refresh(arg0);
+ }
+
+ public void replicate(Object arg0, ReplicationMode arg1) throws HibernateException
+ {
+ delegate.replicate(arg0, arg1);
+ }
+
+ public void replicate(String arg0, Object arg1, ReplicationMode arg2) throws HibernateException
+ {
+ delegate.replicate(arg0, arg1, arg2);
+ }
+
+ public Serializable save(Object arg0) throws HibernateException
+ {
+ return delegate.save(arg0);
+ }
+
+ public Serializable save(String arg0, Object arg1) throws HibernateException
+ {
+ return delegate.save(arg0, arg1);
+ }
+
+ public void saveOrUpdate(Object arg0) throws HibernateException
+ {
+ delegate.saveOrUpdate(arg0);
+ }
+
+ public void saveOrUpdate(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.saveOrUpdate(arg0, arg1);
+ }
+
+ public void setCacheMode(CacheMode arg0)
+ {
+ delegate.setCacheMode(arg0);
+ }
+
+ public void setFlushMode(FlushMode arg0)
+ {
+ delegate.setFlushMode(arg0);
+ }
+
+ public void setReadOnly(Object arg0, boolean arg1)
+ {
+ delegate.setReadOnly(arg0, arg1);
+ }
+
+ public void update(Object arg0) throws HibernateException
+ {
+ delegate.update(arg0);
+ }
+
+ public void update(String arg0, Object arg1) throws HibernateException
+ {
+ delegate.update(arg0, arg1);
+ }
private SessionImplementor getDelegateSessionImplementor()
{
- return (SessionImplementor) getDelegate();
+ return (SessionImplementor) delegate;
}
private EventSource getDelegateEventSource()
{
- return (EventSource) getDelegate();
+ return (EventSource) delegate;
}
public void afterScrollOperation()
Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 12:05:50 UTC (rev 9696)
@@ -2,7 +2,6 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -137,10 +136,8 @@
/**
* Wrap the entityManager before returning it to the application
*/
- public EntityManager proxyEntityManager(EntityManager entityManager) {
- return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
- new Class[] {EntityManager.class},
- new EntityManagerProxy(entityManager));
+ public EntityManager proxyEntityManager(EntityManager entityManager) {
+ return new EntityManagerProxy(entityManager);
}
/**
16 years
Seam SVN: r9695 - in trunk/src/main/org/jboss/seam: util and 1 other directory.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-12-02 04:43:58 -0500 (Tue, 02 Dec 2008)
New Revision: 9695
Added:
trunk/src/main/org/jboss/seam/util/DelegatingInvocationHandler.java
Modified:
trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
JBSEAM-3457
Modified: trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -1,6 +1,7 @@
package org.jboss.seam.persistence;
import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -109,8 +110,10 @@
* Wrap the entityManager before returning it to the application
*/
public EntityManager proxyEntityManager(EntityManager entityManager)
- {
- return new EntityManagerProxy(entityManager);
+ {
+ return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
+ new Class[] {EntityManager.class},
+ new EntityManagerProxy(entityManager));
}
/**
Modified: trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -3,70 +3,30 @@
import java.io.Serializable;
import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-import javax.persistence.FlushModeType;
-import javax.persistence.LockModeType;
import javax.persistence.Query;
import org.jboss.seam.security.permission.PermissionManager;
+import org.jboss.seam.util.DelegatingInvocationHandler;
/**
- * Proxies the EntityManager, and implements EL interpolation
- * in JPA-QL
+ * Proxies the EntityManager, and implements EL interpolation in JPA-QL
*
* @author Gavin King
- *
+ * @author Shane Bryzak
*/
-public class EntityManagerProxy implements EntityManager, Serializable
+public class EntityManagerProxy extends DelegatingInvocationHandler<EntityManager> implements Serializable
{
- private EntityManager delegate;
-
public EntityManagerProxy(EntityManager entityManager)
{
- delegate = entityManager;
+ super(entityManager);
}
- public void clear()
- {
- delegate.clear();
- }
-
- public void close()
- {
- delegate.close();
- }
-
- public boolean contains(Object entity)
- {
- return delegate.contains(entity);
- }
-
- public Query createNamedQuery(String name)
- {
- return delegate.createNamedQuery(name);
- }
-
- public Query createNativeQuery(String sql, Class clazz)
- {
- return delegate.createNativeQuery(sql, clazz);
- }
-
- public Query createNativeQuery(String sql, String lang)
- {
- return delegate.createNativeQuery(sql, lang);
- }
-
- public Query createNativeQuery(String sql)
- {
- return delegate.createNativeQuery(sql);
- }
-
public Query createQuery(String ejbql)
{
if ( ejbql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(ejbql);
- Query query = delegate.createQuery( qp.getEjbql() );
+ Query query = super.getDelegate().createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -78,78 +38,19 @@
}
else
{
- return delegate.createQuery(ejbql);
+ return super.getDelegate().createQuery(ejbql);
}
}
- public <T> T find(Class<T> clazz, Object id)
+ /* public Object getDelegate()
{
- return delegate.find(clazz, id);
- }
+ return PersistenceProvider.instance().proxyDelegate( super.getDelegate().getDelegate() );
+ }*/
- public void flush()
- {
- delegate.flush();
- }
- public Object getDelegate()
- {
- return PersistenceProvider.instance().proxyDelegate( delegate.getDelegate() );
- }
-
- public FlushModeType getFlushMode()
- {
- return delegate.getFlushMode();
- }
-
- public <T> T getReference(Class<T> clazz, Object id)
- {
- return delegate.getReference(clazz, id);
- }
-
- public EntityTransaction getTransaction()
- {
- return delegate.getTransaction();
- }
-
- public boolean isOpen()
- {
- return delegate.isOpen();
- }
-
- public void joinTransaction()
- {
- delegate.joinTransaction();
- }
-
- public void lock(Object entity, LockModeType lm)
- {
- delegate.lock(entity, lm);
- }
-
- public <T> T merge(T entity)
- {
- return delegate.merge(entity);
- }
-
- public void persist(Object entity)
- {
- delegate.persist(entity);
- }
-
- public void refresh(Object entity)
- {
- delegate.refresh(entity);
- }
-
public void remove(Object entity)
{
- delegate.remove(entity);
+ super.getDelegate().remove(entity);
PermissionManager.instance().clearPermissions(entity);
}
-
- public void setFlushMode(FlushModeType fm)
- {
- delegate.setFlushMode(fm);
- }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -1,50 +1,19 @@
//$Id$
package org.jboss.seam.persistence;
-import java.io.Serializable;
-
-import org.apache.lucene.search.Query;
-import org.hibernate.search.SearchFactory;
import org.hibernate.search.jpa.FullTextEntityManager;
-import org.hibernate.search.jpa.FullTextQuery;
+import org.jboss.seam.util.DelegatingInvocationHandler;
/**
* Wrap a FullTextEntityManager
*
* @author Emmanuel Bernard
+ * @author Shane Bryzak
*/
-public class FullTextEntityManagerProxy extends EntityManagerProxy implements FullTextEntityManager
+public class FullTextEntityManagerProxy extends DelegatingInvocationHandler<FullTextEntityManager>
{
- private FullTextEntityManager fullTextEntityManager;
-
public FullTextEntityManagerProxy(FullTextEntityManager entityManager)
{
super(entityManager);
- this.fullTextEntityManager = entityManager;
}
-
- public FullTextQuery createFullTextQuery(Query query, Class... classes)
- {
- return fullTextEntityManager.createFullTextQuery(query, classes);
- }
-
- public void index(Object object)
- {
- fullTextEntityManager.index(object);
- }
-
- public SearchFactory getSearchFactory()
- {
- return fullTextEntityManager.getSearchFactory();
- }
-
- public void purge(Class aClass, Serializable serializable)
- {
- fullTextEntityManager.purge(aClass, serializable);
- }
-
- public void purgeAll(Class aClass)
- {
- fullTextEntityManager.purgeAll(aClass);
- }
}
Modified: trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -1,168 +1,20 @@
package org.jboss.seam.persistence;
-import java.io.Serializable;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-
-import org.hibernate.HibernateException;
-import org.hibernate.Query;
-import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
-import org.hibernate.search.SearchFactory;
-import org.hibernate.type.Type;
+import org.jboss.seam.util.DelegatingInvocationHandler;
/**
* Wraps a Hibernate Search session
*
* @author Gavin King
+ * @author Shane Bryzak
*
*/
@SuppressWarnings("deprecation")
-public class FullTextHibernateSessionProxy extends HibernateSessionProxy implements FullTextSession
-{
- private FullTextSession fullTextSession;
-
+public class FullTextHibernateSessionProxy extends DelegatingInvocationHandler<FullTextSession>
+{
public FullTextHibernateSessionProxy(FullTextSession fullTextSession)
{
super(fullTextSession);
- this.fullTextSession = fullTextSession;
}
-
- public void index(Object arg0)
- {
- fullTextSession.index(arg0);
- }
-
- public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query arg0, Class... arg1)
- {
- return fullTextSession.createFullTextQuery(arg0, arg1);
- }
-
- public Query createSQLQuery(String arg0, String arg1, Class arg2)
- {
- return fullTextSession.createSQLQuery(arg0, arg1, arg2);
- }
-
- public Query createSQLQuery(String arg0, String[] arg1, Class[] arg2)
- {
- return fullTextSession.createSQLQuery(arg0, arg1, arg2);
- }
-
- public int delete(String arg0, Object arg1, Type arg2) throws HibernateException
- {
- return fullTextSession.delete(arg0, arg1, arg2);
- }
-
- public int delete(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
- {
- return fullTextSession.delete(arg0, arg1, arg2);
- }
-
- public int delete(String arg0) throws HibernateException
- {
- return fullTextSession.delete(arg0);
- }
-
- public Collection filter(Object arg0, String arg1, Object arg2, Type arg3) throws HibernateException
- {
- return fullTextSession.filter(arg0, arg1, arg2, arg3);
- }
-
- public Collection filter(Object arg0, String arg1, Object[] arg2, Type[] arg3) throws HibernateException
- {
- return fullTextSession.filter(arg0, arg1, arg2, arg3);
- }
-
- public Collection filter(Object arg0, String arg1) throws HibernateException
- {
- return fullTextSession.filter(arg0, arg1);
- }
-
- public List find(String arg0, Object arg1, Type arg2) throws HibernateException
- {
- return fullTextSession.find(arg0, arg1, arg2);
- }
-
- public List find(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
- {
- return fullTextSession.find(arg0, arg1, arg2);
- }
-
- public List find(String arg0) throws HibernateException
- {
- return fullTextSession.find(arg0);
- }
-
-
- public SearchFactory getSearchFactory()
- {
- return fullTextSession.getSearchFactory();
- }
-
- public void purge(Class aClass, Serializable serializable)
- {
- fullTextSession.purge(aClass, serializable);
- }
-
- public void purgeAll(Class aClass)
- {
- fullTextSession.purgeAll(aClass);
- }
-
- public Iterator iterate(String arg0, Object arg1, Type arg2) throws HibernateException
- {
- return fullTextSession.iterate(arg0, arg1, arg2);
- }
-
- public Iterator iterate(String arg0, Object[] arg1, Type[] arg2) throws HibernateException
- {
- return fullTextSession.iterate(arg0, arg1, arg2);
- }
-
- public Iterator iterate(String arg0) throws HibernateException
- {
- return fullTextSession.iterate(arg0);
- }
-
- public void save(Object arg0, Serializable arg1) throws HibernateException
- {
- fullTextSession.save(arg0, arg1);
- }
-
- public void save(String arg0, Object arg1, Serializable arg2) throws HibernateException
- {
- fullTextSession.save(arg0, arg1, arg2);
- }
-
- public Object saveOrUpdateCopy(Object arg0, Serializable arg1) throws HibernateException
- {
- return fullTextSession.saveOrUpdateCopy(arg0, arg1);
- }
-
- public Object saveOrUpdateCopy(Object arg0) throws HibernateException
- {
- return fullTextSession.saveOrUpdateCopy(arg0);
- }
-
- public Object saveOrUpdateCopy(String arg0, Object arg1, Serializable arg2) throws HibernateException
- {
- return fullTextSession.saveOrUpdateCopy(arg0, arg1, arg2);
- }
-
- public Object saveOrUpdateCopy(String arg0, Object arg1) throws HibernateException
- {
- return fullTextSession.saveOrUpdateCopy(arg0, arg1);
- }
-
- public void update(Object arg0, Serializable arg1) throws HibernateException
- {
- fullTextSession.update(arg0, arg1);
- }
-
- public void update(String arg0, Object arg1, Serializable arg2) throws HibernateException
- {
- fullTextSession.update(arg0, arg1, arg2);
- }
-
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -4,6 +4,7 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.util.Collection;
import java.util.Map;
@@ -16,6 +17,7 @@
import org.hibernate.Session;
import org.hibernate.StaleStateException;
import org.hibernate.TransientObjectException;
+import org.hibernate.engine.SessionImplementor;
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.type.VersionType;
@@ -93,7 +95,9 @@
{
if (FULL_TEXT_SESSION_PROXY_CONSTRUCTOR==null)
{
- return new HibernateSessionProxy(session);
+ return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
+ new Class[] {Session.class, SessionImplementor.class},
+ new HibernateSessionProxy(session));
}
else
{
@@ -102,7 +106,9 @@
}
catch(Exception e) {
log.warn("Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned", e);
- return new HibernateSessionProxy(session);
+ return (Session) Proxy.newProxyInstance(Session.class.getClassLoader(),
+ new Class[] {Session.class, SessionImplementor.class},
+ new HibernateSessionProxy(session));
}
}
}
Modified: trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -1,36 +1,26 @@
package org.jboss.seam.persistence;
import java.io.Serializable;
-import java.sql.Connection;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import org.hibernate.CacheMode;
-import org.hibernate.Criteria;
-import org.hibernate.EntityMode;
-import org.hibernate.Filter;
-import org.hibernate.FlushMode;
import org.hibernate.HibernateException;
import org.hibernate.Interceptor;
-import org.hibernate.LockMode;
import org.hibernate.Query;
-import org.hibernate.ReplicationMode;
-import org.hibernate.SQLQuery;
import org.hibernate.ScrollMode;
import org.hibernate.ScrollableResults;
import org.hibernate.Session;
-import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.collection.PersistentCollection;
+import org.hibernate.engine.ActionQueue;
+import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.EntityKey;
import org.hibernate.engine.PersistenceContext;
import org.hibernate.engine.QueryParameters;
import org.hibernate.engine.SessionFactoryImplementor;
import org.hibernate.engine.SessionImplementor;
-import org.hibernate.engine.ActionQueue;
-import org.hibernate.engine.EntityEntry;
import org.hibernate.engine.query.sql.NativeSQLQuerySpecification;
import org.hibernate.event.EventListeners;
import org.hibernate.event.EventSource;
@@ -39,8 +29,8 @@
import org.hibernate.jdbc.JDBCContext;
import org.hibernate.loader.custom.CustomQuery;
import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.stat.SessionStatistics;
import org.hibernate.type.Type;
+import org.jboss.seam.util.DelegatingInvocationHandler;
/**
* Proxies the Session, and implements EL interpolation
@@ -49,83 +39,25 @@
*
* @author Gavin King
* @author Emmanuel Bernard
- * FIXME: EventSource should not really be there, remove once HSearch is fixed
+ * @author Shane Bryzak
*
*/
-public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
-{
- private Session delegate;
-
+public class HibernateSessionProxy extends DelegatingInvocationHandler<Session>
+{
/**
* Don't use that constructor directly, use HibernatePersistenceProvider.proxySession()
*/
public HibernateSessionProxy(Session session)
{
- delegate = session;
- }
+ super(session);
+ }
- public Transaction beginTransaction() throws HibernateException
- {
- return delegate.beginTransaction();
- }
-
- public void cancelQuery() throws HibernateException
- {
- delegate.cancelQuery();
- }
-
- public void clear()
- {
- delegate.clear();
- }
-
- public Connection close() throws HibernateException
- {
- return delegate.close();
- }
-
- @SuppressWarnings("deprecation")
- public Connection connection() throws HibernateException
- {
- return delegate.connection();
- }
-
- public boolean contains(Object arg0)
- {
- return delegate.contains(arg0);
- }
-
- public Criteria createCriteria(Class arg0, String arg1)
- {
- return delegate.createCriteria(arg0, arg1);
- }
-
- public Criteria createCriteria(Class arg0)
- {
- return delegate.createCriteria(arg0);
- }
-
- public Criteria createCriteria(String arg0, String arg1)
- {
- return delegate.createCriteria(arg0, arg1);
- }
-
- public Criteria createCriteria(String arg0)
- {
- return delegate.createCriteria(arg0);
- }
-
- public Query createFilter(Object arg0, String arg1) throws HibernateException
- {
- return delegate.createFilter(arg0, arg1);
- }
-
public Query createQuery(String hql) throws HibernateException
{
if ( hql.indexOf('#')>0 )
{
QueryParser qp = new QueryParser(hql);
- Query query = delegate.createQuery( qp.getEjbql() );
+ Query query = getDelegate().createQuery( qp.getEjbql() );
for (int i=0; i<qp.getParameterValueBindings().size(); i++)
{
query.setParameter(
@@ -137,283 +69,23 @@
}
else
{
- return delegate.createQuery(hql);
+ return getDelegate().createQuery(hql);
}
}
- public SQLQuery createSQLQuery(String arg0) throws HibernateException
- {
- return delegate.createSQLQuery(arg0);
- }
-
- public void delete(Object arg0) throws HibernateException
- {
- delegate.delete(arg0);
- }
-
- public void delete(String arg0, Object arg1) throws HibernateException
- {
- delegate.delete(arg0, arg1);
- }
-
- public void disableFilter(String arg0)
- {
- delegate.disableFilter(arg0);
- }
-
- public Connection disconnect() throws HibernateException
- {
- return delegate.disconnect();
- }
-
- public Filter enableFilter(String arg0)
- {
- return delegate.enableFilter(arg0);
- }
-
- public void evict(Object arg0) throws HibernateException
- {
- delegate.evict(arg0);
- }
-
- public void flush() throws HibernateException
- {
- delegate.flush();
- }
-
- public Object get(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
- {
- return delegate.get(arg0, arg1, arg2);
- }
-
- public Object get(Class arg0, Serializable arg1) throws HibernateException
- {
- return delegate.get(arg0, arg1);
- }
-
- public Object get(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
- {
- return delegate.get(arg0, arg1, arg2);
- }
-
- public Object get(String arg0, Serializable arg1) throws HibernateException
- {
- return delegate.get(arg0, arg1);
- }
-
- public CacheMode getCacheMode()
- {
- return delegate.getCacheMode();
- }
-
- public LockMode getCurrentLockMode(Object arg0) throws HibernateException
- {
- return delegate.getCurrentLockMode(arg0);
- }
-
- public Filter getEnabledFilter(String arg0)
- {
- return delegate.getEnabledFilter(arg0);
- }
-
- public EntityMode getEntityMode()
- {
- return delegate.getEntityMode();
- }
-
- public String getEntityName(Object arg0) throws HibernateException
- {
- return delegate.getEntityName(arg0);
- }
-
- public FlushMode getFlushMode()
- {
- return delegate.getFlushMode();
- }
-
- public Serializable getIdentifier(Object arg0) throws HibernateException
- {
- return delegate.getIdentifier(arg0);
- }
-
- public Query getNamedQuery(String arg0) throws HibernateException
- {
- return delegate.getNamedQuery(arg0);
- }
-
- public Session getSession(EntityMode arg0)
- {
- return delegate.getSession(arg0);
- }
-
- public SessionFactory getSessionFactory()
- {
- return delegate.getSessionFactory();
- }
-
- public SessionStatistics getStatistics()
- {
- return delegate.getStatistics();
- }
-
- public Transaction getTransaction()
- {
- return delegate.getTransaction();
- }
-
- public boolean isConnected()
- {
- return delegate.isConnected();
- }
-
- public boolean isDirty() throws HibernateException
- {
- return delegate.isDirty();
- }
-
- public boolean isOpen()
- {
- return delegate.isOpen();
- }
-
- public Object load(Class arg0, Serializable arg1, LockMode arg2) throws HibernateException
- {
- return delegate.load(arg0, arg1, arg2);
- }
-
- public Object load(Class arg0, Serializable arg1) throws HibernateException
- {
- return delegate.load(arg0, arg1);
- }
-
- public void load(Object arg0, Serializable arg1) throws HibernateException
- {
- delegate.load(arg0, arg1);
- }
-
- public Object load(String arg0, Serializable arg1, LockMode arg2) throws HibernateException
- {
- return delegate.load(arg0, arg1, arg2);
- }
-
- public Object load(String arg0, Serializable arg1) throws HibernateException
- {
- return delegate.load(arg0, arg1);
- }
-
- public void lock(Object arg0, LockMode arg1) throws HibernateException
- {
- delegate.lock(arg0, arg1);
- }
-
- public void lock(String arg0, Object arg1, LockMode arg2) throws HibernateException
- {
- delegate.lock(arg0, arg1, arg2);
- }
-
- public Object merge(Object arg0) throws HibernateException
- {
- return delegate.merge(arg0);
- }
-
- public Object merge(String arg0, Object arg1) throws HibernateException
- {
- return delegate.merge(arg0, arg1);
- }
-
- public void persist(Object arg0) throws HibernateException
- {
- delegate.persist(arg0);
- }
-
- public void persist(String arg0, Object arg1) throws HibernateException
- {
- delegate.persist(arg0, arg1);
- }
-
public void reconnect() throws HibernateException
{
throw new UnsupportedOperationException("deprecated");
}
-
- public void reconnect(Connection arg0) throws HibernateException
- {
- delegate.reconnect(arg0);
- }
-
- public void refresh(Object arg0, LockMode arg1) throws HibernateException
- {
- delegate.refresh(arg0, arg1);
- }
-
- public void refresh(Object arg0) throws HibernateException
- {
- delegate.refresh(arg0);
- }
-
- public void replicate(Object arg0, ReplicationMode arg1) throws HibernateException
- {
- delegate.replicate(arg0, arg1);
- }
-
- public void replicate(String arg0, Object arg1, ReplicationMode arg2) throws HibernateException
- {
- delegate.replicate(arg0, arg1, arg2);
- }
-
- public Serializable save(Object arg0) throws HibernateException
- {
- return delegate.save(arg0);
- }
-
- public Serializable save(String arg0, Object arg1) throws HibernateException
- {
- return delegate.save(arg0, arg1);
- }
-
- public void saveOrUpdate(Object arg0) throws HibernateException
- {
- delegate.saveOrUpdate(arg0);
- }
-
- public void saveOrUpdate(String arg0, Object arg1) throws HibernateException
- {
- delegate.saveOrUpdate(arg0, arg1);
- }
-
- public void setCacheMode(CacheMode arg0)
- {
- delegate.setCacheMode(arg0);
- }
-
- public void setFlushMode(FlushMode arg0)
- {
- delegate.setFlushMode(arg0);
- }
-
- public void setReadOnly(Object arg0, boolean arg1)
- {
- delegate.setReadOnly(arg0, arg1);
- }
-
- public void update(Object arg0) throws HibernateException
- {
- delegate.update(arg0);
- }
-
- public void update(String arg0, Object arg1) throws HibernateException
- {
- delegate.update(arg0, arg1);
- }
private SessionImplementor getDelegateSessionImplementor()
{
- return (SessionImplementor) delegate;
+ return (SessionImplementor) getDelegate();
}
private EventSource getDelegateEventSource()
{
- return (EventSource) delegate;
+ return (EventSource) getDelegate();
}
public void afterScrollOperation()
Modified: trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 01:09:08 UTC (rev 9694)
+++ trunk/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -2,6 +2,7 @@
import static org.jboss.seam.annotations.Install.BUILT_IN;
import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
import java.util.Date;
import javax.persistence.EntityManager;
@@ -136,8 +137,10 @@
/**
* Wrap the entityManager before returning it to the application
*/
- public EntityManager proxyEntityManager(EntityManager entityManager) {
- return new EntityManagerProxy(entityManager);
+ public EntityManager proxyEntityManager(EntityManager entityManager) {
+ return (EntityManager) Proxy.newProxyInstance(EntityManager.class.getClassLoader(),
+ new Class[] {EntityManager.class},
+ new EntityManagerProxy(entityManager));
}
/**
Added: trunk/src/main/org/jboss/seam/util/DelegatingInvocationHandler.java
===================================================================
--- trunk/src/main/org/jboss/seam/util/DelegatingInvocationHandler.java (rev 0)
+++ trunk/src/main/org/jboss/seam/util/DelegatingInvocationHandler.java 2008-12-02 09:43:58 UTC (rev 9695)
@@ -0,0 +1,100 @@
+package org.jboss.seam.util;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.seam.log.Log;
+import org.jboss.seam.log.Logging;
+
+/**
+ * An InvocationHandler implementation that delegates method invocations to a specified object,
+ * optionally allowing the method to be overridden locally.
+ *
+ * @author Shane Bryzak
+ */
+public class DelegatingInvocationHandler<T> implements InvocationHandler
+{
+ private static Log log = Logging.getLog(DelegatingInvocationHandler.class);
+
+ private class MethodTarget
+ {
+ public Method method;
+ public Object target;
+
+ public MethodTarget(Object target, Method method)
+ {
+ this.target = target;
+ this.method = method;
+ }
+ }
+
+ private Map<Method,MethodTarget> methodCache = new HashMap<Method,MethodTarget>();
+ private T delegate;
+
+ public DelegatingInvocationHandler(T delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public T getDelegate()
+ {
+ return delegate;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args)
+ throws Throwable
+ {
+ MethodTarget target = methodCache.get(method);
+
+ if (target == null && !methodCache.containsKey(method))
+ {
+ synchronized(methodCache)
+ {
+ if (!methodCache.containsKey(method))
+ {
+ try
+ {
+ target = new MethodTarget(this, getClass().getMethod(method.getName(), method.getParameterTypes()));
+ }
+ catch (NoSuchMethodException ex)
+ {
+ // Swallow this, we'll try to find a matching method on the delegate
+ }
+
+ if (target == null)
+ {
+ try
+ {
+ target = new MethodTarget(delegate, delegate.getClass().getMethod(method.getName(), method.getParameterTypes()));
+ }
+ catch (NoSuchMethodException ex)
+ {
+ // Swallow this, put a null entry in methodCache
+ }
+ }
+
+ methodCache.put(method, target);
+ }
+ else
+ {
+ target = methodCache.get(method);
+ }
+ }
+ }
+
+ if (target == null)
+ {
+ throw new IllegalStateException("Proxied session does not implement method " + method.getName() +
+ " with args [" + args + "]");
+ }
+
+ if (log.isTraceEnabled())
+ {
+ log.trace("Delegating method " + method.getName() + " with args " + args);
+ }
+
+ return target.method.invoke(target.target, args);
+ }
+}
16 years
Seam SVN: r9694 - trunk/seam-gen.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-12-01 20:09:08 -0500 (Mon, 01 Dec 2008)
New Revision: 9694
Modified:
trunk/seam-gen/build.xml
Log:
JBSEAM-3751
Modified: trunk/seam-gen/build.xml
===================================================================
--- trunk/seam-gen/build.xml 2008-12-02 01:08:21 UTC (rev 9693)
+++ trunk/seam-gen/build.xml 2008-12-02 01:09:08 UTC (rev 9694)
@@ -670,6 +670,7 @@
file="${templates.dir}/build-scripts/build-war.xml">
<filterset refid="project"/>
</copy>
+ <copy file="${seam.dir}/build/validate.xml" todir="${project.home}" overwrite="true"/>
<copy todir="${project.home}/resources">
<fileset dir="${templates.dir}/resources/">
<include name="META-INF/orm.xml"/>
16 years
Seam SVN: r9693 - trunk/src/test/unit/org/jboss/seam/test/unit.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-12-01 20:08:21 -0500 (Mon, 01 Dec 2008)
New Revision: 9693
Modified:
trunk/src/test/unit/org/jboss/seam/test/unit/testng.xml
Log:
add ExpressionsTest to test suite
Modified: trunk/src/test/unit/org/jboss/seam/test/unit/testng.xml
===================================================================
--- trunk/src/test/unit/org/jboss/seam/test/unit/testng.xml 2008-12-02 01:00:41 UTC (rev 9692)
+++ trunk/src/test/unit/org/jboss/seam/test/unit/testng.xml 2008-12-02 01:08:21 UTC (rev 9693)
@@ -9,6 +9,7 @@
<class name="org.jboss.seam.test.unit.ComponentTest"/>
<class name="org.jboss.seam.test.unit.ContextTest"/>
<class name="org.jboss.seam.test.unit.DependencyTest"/>
+ <class name="org.jboss.seam.test.unit.ExpressionsTest"/>
</classes>
</test>
16 years
Seam SVN: r9692 - in trunk/examples: spring and 2 other directories.
by seam-commits@lists.jboss.org
Author: dan.j.allen
Date: 2008-12-01 20:00:41 -0500 (Mon, 01 Dec 2008)
New Revision: 9692
Added:
trunk/examples/spring/resources/META-INF/persistence-spring.xml
Removed:
trunk/examples/spring/resources/META-INF/persistence.xml
Modified:
trunk/examples/build.xml
trunk/examples/spring/build-jbosswar.xml
trunk/examples/spring/build.xml
trunk/examples/spring/resources/WEB-INF/applicationContext.xml
Log:
preliminary work for JBSEAM-3587
Modified: trunk/examples/build.xml
===================================================================
--- trunk/examples/build.xml 2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/build.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -303,6 +303,12 @@
<include name="drools-compiler.jar" if="drools.lib" />
</fileset>
+ <!-- Dependencies for using Spring with Cglib -->
+ <fileset id="cglib.jar" dir="${lib.dir}">
+ <include name="asm.jar" if="cglib.lib"/>
+ <include name="cglib.jar" if="cglib.lib"/>
+ </fileset>
+
<!-- Dependencies for using Seam with JCaptcha -->
<fileset id="jcaptcha.jar" dir="${lib.dir}">
<include name="jcaptcha-all*.jar" if="jcaptcha.lib" />
@@ -665,6 +671,7 @@
<fileset refid="richfaces-api.jar" />
<fileset refid="ear.lib.extras" />
<fileset refid="jboss-el.jar" />
+ <fileset refid="cglib.jar" />
<fileset refid="drools.jar" />
<fileset refid="jbpm.jar" />
<fileset refid="cache.jar" />
@@ -816,6 +823,7 @@
<copy todir="${war.dir}/WEB-INF/lib">
<fileset refid="seam.jar" />
<fileset refid="tomcat.war.extras" />
+ <fileset refid="cglib.jar" />
<fileset refid="drools.jar" />
<fileset refid="cache.jar" />
<fileset refid="jbpm.jar" />
@@ -881,6 +889,7 @@
<copy todir="${war.dir}/WEB-INF/lib">
<fileset refid="seam.jar" />
<fileset refid="noejb.war.lib.extras" />
+ <fileset refid="cglib.jar" />
<fileset refid="drools.jar" />
<fileset refid="cache.jar" />
<fileset refid="jbpm.jar" />
Modified: trunk/examples/spring/build-jbosswar.xml
===================================================================
--- trunk/examples/spring/build-jbosswar.xml 2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/build-jbosswar.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -20,7 +20,13 @@
<!-- needed because jboss must include hibernate search -->
<property name="search.lib" value="true"/>
<property name="richfaces.lib" value="true"/>
+ <property name="cglib.lib" value="true"/>
<import file="../build.xml"/>
+
+ <fileset id="noejb.jar.extras" dir="${resources.dir}">
+ <include name="META-INF/persistence-spring.xml"/>
+ </fileset>
+
</project>
Modified: trunk/examples/spring/build.xml
===================================================================
--- trunk/examples/spring/build.xml 2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/build.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -10,6 +10,8 @@
<ant antfile="build-jbosswar.xml" target="jbosswar.undeploy"/>
</target>
+ <target name="jbosswar.redeploy" description="Rebuild and redeploy the Spring example from JBoss AS" depends="jbosswar.undeploy,clean,jbosswar"/>
+
<target name="clean" description="Clean up the example">
<ant antfile="build-jbosswar.xml" target="clean" />
</target>
Copied: trunk/examples/spring/resources/META-INF/persistence-spring.xml (from rev 9688, trunk/examples/spring/resources/META-INF/persistence.xml)
===================================================================
--- trunk/examples/spring/resources/META-INF/persistence-spring.xml (rev 0)
+++ trunk/examples/spring/resources/META-INF/persistence-spring.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<persistence xmlns="http://java.sun.com/xml/ns/persistence"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://java.sun.com/xml/ns/persistence
+ http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
+ version="1.0">
+ <persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+ <properties>
+ <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
+ <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
+
+ <!-- Use these vendor-specific properties to setup JDBC connection instead of using Spring configuration -->
+ <!--
+ <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
+ <property name="hibernate.connection.username" value="sa"/>
+ <property name="hibernate.connection.password" value=""/>
+ <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
+ -->
+ </properties>
+ </persistence-unit>
+</persistence>
Property changes on: trunk/examples/spring/resources/META-INF/persistence-spring.xml
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Deleted: trunk/examples/spring/resources/META-INF/persistence.xml
===================================================================
--- trunk/examples/spring/resources/META-INF/persistence.xml 2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/resources/META-INF/persistence.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<persistence xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="
- http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
- version="1.0">
- <persistence-unit name="bookingDatabase" transaction-type="RESOURCE_LOCAL">
- <provider>org.hibernate.ejb.HibernatePersistence</provider>
- <properties>
- <property name="hibernate.hbm2ddl.auto" value="create-drop"/>
- <property name="hibernate.show_sql" value="true"/>
- <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
- <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
-
- <!-- Enable these vendor-specific properties to setup JDBC connection here rather than in Spring configuration -->
- <!--
- <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
- <property name="hibernate.connection.username" value="sa"/>
- <property name="hibernate.connection.password" value=""/>
- <property name="hibernate.connection.url" value="jdbc:hsqldb:mem:defaultDB"/>
- -->
- </properties>
- </persistence-unit>
-</persistence>
Modified: trunk/examples/spring/resources/WEB-INF/applicationContext.xml
===================================================================
--- trunk/examples/spring/resources/WEB-INF/applicationContext.xml 2008-12-01 23:18:41 UTC (rev 9691)
+++ trunk/examples/spring/resources/WEB-INF/applicationContext.xml 2008-12-02 01:00:41 UTC (rev 9692)
@@ -25,6 +25,8 @@
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource"/>
<property name="persistenceUnitName" value="bookingDatabase"/>
+ <!-- Use alternate location to prevent JBoss AS from automatically loading persistence units (in-container) -->
+ <property name="persistenceXmlLocation" value="classpath:META-INF/persistence-spring.xml"/>
</bean>
<!-- This example uses resource local JpaTransactionManager. You could just as easily use a JtaTransactionManager -->
16 years
Seam SVN: r9691 - in trunk/examples/openid: resources/WEB-INF and 1 other directories.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-12-01 18:18:41 -0500 (Mon, 01 Dec 2008)
New Revision: 9691
Removed:
trunk/examples/openid/view/index.html
Modified:
trunk/examples/openid/resources/WEB-INF/components.xml
trunk/examples/openid/resources/WEB-INF/pages.xml
trunk/examples/openid/resources/import.sql
trunk/examples/openid/view/main.xhtml
Log:
a few improvements to the openid example
Modified: trunk/examples/openid/resources/WEB-INF/components.xml
===================================================================
--- trunk/examples/openid/resources/WEB-INF/components.xml 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/resources/WEB-INF/components.xml 2008-12-01 23:18:41 UTC (rev 9691)
@@ -3,6 +3,7 @@
xmlns:persistence="http://jboss.com/products/seam/persistence"
xmlns:security="http://jboss.com/products/seam/security" xmlns:framework="http://jboss.com/products/seam/framework"
xmlns:transaction="http://jboss.com/products/seam/transaction"
+ xmlns:web="http://jboss.com/products/seam/web"
xmlns:international="http://jboss.com/products/seam/international"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.com/products/seam/core /Users/orb/proj/jboss/seam/trunk/src/main/org/jboss/seam/core-2.1.xsd
@@ -16,6 +17,8 @@
<core:manager conversation-timeout="1200000" concurrent-request-timeout="50000" conversation-id-parameter="cid"/>
+ <web:rewrite-filter />
+
<transaction:ejb-transaction/>
<security:identity authenticate-method="#{authenticator.authenticate}"/>
Modified: trunk/examples/openid/resources/WEB-INF/pages.xml
===================================================================
--- trunk/examples/openid/resources/WEB-INF/pages.xml 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/resources/WEB-INF/pages.xml 2008-12-01 23:18:41 UTC (rev 9691)
@@ -7,26 +7,29 @@
<navigation evaluate="#{openid.loginImmediately()}">
<rule if-outcome="true">
<redirect view-id="/main.xhtml">
- <message>Welcome #{openid.validatedId}</message>
+ <message>OpenID login successful...</message>
</redirect>
</rule>
<rule if-outcome="false">
<redirect view-id="/main.xhtml">
- <message>OpenID login failed...</message>
+ <message>OpenID login rejected...</message>
</redirect>
</rule>
</navigation>
</page>
<page view-id="/main.xhtml">
+ <rewrite pattern="/" />
+
<navigation from-action="#{postHome.persist}" evaluate="#{postHome.clearInstance()}">
- <redirect />
+ <redirect view-id="/main.xhtml" />
</navigation>
</page>
- <exception class="org.jboss.seam.security.NotLoggedInException">
- <redirect view-id="/home.xhtml">
- <message severity="warn">You must be logged in to use this feature</message>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/main.xhtml">
+ <message severity="warn">Your session expired. Please try again.</message>
</redirect>
</exception>
Modified: trunk/examples/openid/resources/import.sql
===================================================================
--- trunk/examples/openid/resources/import.sql 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/resources/import.sql 2008-12-01 23:18:41 UTC (rev 9691)
@@ -1 +1,2 @@
-insert into post (creator,message,createDate) values ('http://maximoburrito.myopenid.com/','This is too cool',now());
+insert into post (creator,message,createDate) values ('http://maximoburrito.myopenid.com/','First Post!',now());
+insert into post (creator,message,createDate) values ('http://maximoburrito.myopenid.com/','Have fun with Seam!',now());
Deleted: trunk/examples/openid/view/index.html
===================================================================
--- trunk/examples/openid/view/index.html 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/view/index.html 2008-12-01 23:18:41 UTC (rev 9691)
@@ -1,5 +0,0 @@
-<html>
-<head>
- <meta http-equiv="Refresh" content="0; URL=main.seam">
-</head>
-</html>
Modified: trunk/examples/openid/view/main.xhtml
===================================================================
--- trunk/examples/openid/view/main.xhtml 2008-12-01 23:18:14 UTC (rev 9690)
+++ trunk/examples/openid/view/main.xhtml 2008-12-01 23:18:41 UTC (rev 9691)
@@ -15,14 +15,10 @@
}
</style>
-
</head>
<body>
<div id="top">
-
-
-
<rich:toolBar height="34" itemSeparator="line">
<rich:toolBarGroup>
<h:outputLabel value="OpenId Wall Demo" />
@@ -47,28 +43,22 @@
<rich:panel>
<f:facet name="header">About the Demo</f:facet>
- <rich:modalPanel id="panel" width="350" height="100">
- <f:facet name="header">
- <h:panelGroup>OpenID</h:panelGroup>
- </f:facet>
- <f:facet name="controls">
- <h:panelGroup>
- <h:graphicImage value="/images/modal/close.png" style="cursor:pointer" id="hidelink"/>
- <rich:componentControl for="panel" attachTo="hidelink" operation="hide" event="onclick"/>
- </h:panelGroup>
- </f:facet>
-
- OpenID is cool...
- </rich:modalPanel>
-
-
-
+
<rich:messages />
-
- <h:outputLink value="#" id="link">
- Learn more about OpenID
- <rich:componentControl for="panel" attachTo="link" operation="show" event="onclick"/>
- </h:outputLink>
+
+ <s:div rendered="#{!identity.loggedIn}">
+ This application demonstrates the basic use of OpenID in an application. To login, simply enter
+ your OpenId into the login box at the top. Don't have an OpenId? Actually, you might have one
+ and not know it. If you have a <a href="http://openid.yahoo.com/">Yahoo</a> account, a
+ <a href="http://www.livejournal.com/openid/">liveournal</a> account, a blog at
+ <a href="http://blogger.com">blogger.com</a>, to name a few you might already have an
+ OpenID available to you. If not, you can establish an independent OpenID at
+ a free service like <a href="https://www.myopenid.com/">myOpenID</a>.
+ </s:div>
+
+ <s:div rendered="#{identity.loggedIn}">
+ Congratulations, you have logged into the Wall with an OpenID of <b>#{openid.validatedId}</b>.
+ </s:div>
</rich:panel>
@@ -89,7 +79,10 @@
<rich:panel>
#{post.message}
<br />
- #{post.creator} -- #{post.createDate}
+ <b>#{post.creator}</b> --
+ <h:outputText value="#{post.createDate}">
+ <s:convertDateTime dateStyle="full" type="both" />
+ </h:outputText>
</rich:panel>
</ui:repeat>
</rich:panel>
16 years
Seam SVN: r9690 - trunk/src/main/org/jboss/seam/security/openid.
by seam-commits@lists.jboss.org
Author: norman.richards(a)jboss.com
Date: 2008-12-01 18:18:14 -0500 (Mon, 01 Dec 2008)
New Revision: 9690
Modified:
trunk/src/main/org/jboss/seam/security/openid/OpenId.java
Log:
fix for invalid openid
Modified: trunk/src/main/org/jboss/seam/security/openid/OpenId.java
===================================================================
--- trunk/src/main/org/jboss/seam/security/openid/OpenId.java 2008-12-01 23:05:23 UTC (rev 9689)
+++ trunk/src/main/org/jboss/seam/security/openid/OpenId.java 2008-12-01 23:18:14 UTC (rev 9690)
@@ -68,21 +68,21 @@
context.getApplication().getViewHandler().getActionURL(context, "/openid.xhtml");
return returnToUrl;
}
- public void login()
- throws IOException
- {
+
+ public void login() throws IOException {
validatedId = null;
String returnToUrl = returnToUrl();
String url = authRequest(id, returnToUrl);
-
- Redirect redirect = Redirect.instance();
- redirect.captureCurrentView();
-
- FacesManager.instance().redirectToExternalURL(url);
+
+ if (url != null) {
+ Redirect redirect = Redirect.instance();
+ redirect.captureCurrentView();
+
+ FacesManager.instance().redirectToExternalURL(url);
+ }
}
-
// --- placing the authentication request ---
@SuppressWarnings("unchecked")
protected String authRequest(String userSuppliedString, String returnToUrl)
16 years
Seam SVN: r9689 - trunk/build.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2008-12-01 18:05:23 -0500 (Mon, 01 Dec 2008)
New Revision: 9689
Modified:
trunk/build/root.pom.xml
Log:
JBSEAM-3773
Modified: trunk/build/root.pom.xml
===================================================================
--- trunk/build/root.pom.xml 2008-12-01 22:41:36 UTC (rev 9688)
+++ trunk/build/root.pom.xml 2008-12-01 23:05:23 UTC (rev 9689)
@@ -38,7 +38,7 @@
<!-- Externalize some version numbers here -->
<properties>
- <version.richfaces>3.2.2.GA</version.richfaces>
+ <version.richfaces>3.2.2.SR1</version.richfaces>
<version.wicket>1.3.3</version.wicket>
<version.drools>4.0.4</version.drools>
</properties>
16 years