Seam SVN: r12072 - tags.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-02-24 09:30:07 -0500 (Wed, 24 Feb 2010)
New Revision: 12072
Added:
tags/JBoss_Seam_2_2_1_CR1/
Log:
create JBoss_Seam_2_2_1_CR1 tag
Copied: tags/JBoss_Seam_2_2_1_CR1 (from rev 12071, branches/community/Seam_2_2)
14 years, 10 months
Seam SVN: r12071 - in branches/community/Seam_2_2: build and 1 other directory.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-02-24 04:11:51 -0500 (Wed, 24 Feb 2010)
New Revision: 12071
Modified:
branches/community/Seam_2_2/build/default.build.properties
branches/community/Seam_2_2/changelog.txt
branches/community/Seam_2_2/readme.txt
Log:
Updated version for release of 2.2.1.CR1
Modified: branches/community/Seam_2_2/build/default.build.properties
===================================================================
--- branches/community/Seam_2_2/build/default.build.properties 2010-02-23 20:35:56 UTC (rev 12070)
+++ branches/community/Seam_2_2/build/default.build.properties 2010-02-24 09:11:51 UTC (rev 12071)
@@ -8,7 +8,7 @@
major.version 2
minor.version .2
patchlevel .1
-qualifier -SNAPSHOT
+qualifier .CR1
#
# Other program locations
# -----------------------
Modified: branches/community/Seam_2_2/changelog.txt
===================================================================
--- branches/community/Seam_2_2/changelog.txt 2010-02-23 20:35:56 UTC (rev 12070)
+++ branches/community/Seam_2_2/changelog.txt 2010-02-24 09:11:51 UTC (rev 12071)
@@ -2,6 +2,126 @@
====================
+Release Notes - Seam - Version 2.2.1.CR1
+
+** Bug
+ * [JBSEAM-2082] - JMS Topic subscriptions never released
+ * [JBSEAM-2292] - Resources from resource servlet can't be re-rendered
+ * [JBSEAM-2419] - IAE: factory method with defined scope outjected a value: guestRole
+ * [JBSEAM-3305] - Seam testsuite skipping and failing many tests on windows XP machine
+ * [JBSEAM-3475] - Seamspace example - InvalidStateException at friend request
+ * [JBSEAM-3702] - NotBoundException when undeploying Seam examples on AS5
+ * [JBSEAM-3703] - bug in JbpmElResolver
+ * [JBSEAM-3721] - Seam Remoting Callback not set before server response comes back
+ * [JBSEAM-3778] - MDB - IllegalStateException: No event context active
+ * [JBSEAM-3844] - Hot deployment : You are trying to use a connection factory that has been shut down
+ * [JBSEAM-3906] - Attachements are not shown in outlook
+ * [JBSEAM-3996] - Seam should ignore duplicate classes on classpath
+ * [JBSEAM-4029] - NPE in JBossClusterMonitor.locateJBoss when other non-JBoss JMX servers are present
+ * [JBSEAM-4067] - ELSupport.coerceToType modifies BigDecimal Values
+ * [JBSEAM-4087] - Regexp Query.SUBJECT_PATTERN may be improved for JBSEAM-3032
+ * [JBSEAM-4187] - double-quotes is not correctly encoded during CSV export
+ * [JBSEAM-4191] - TransactionsAttribute.SUPPORTS in EjbSynchronisations
+ * [JBSEAM-4192] - s.tld in jboss-seam.ui.jar/MANIFEST.MF/ is not valid
+ * [JBSEAM-4196] - Infinite Loop bug in JBPM integration
+ * [JBSEAM-4203] - Interpolator swallows all exceptions
+ * [JBSEAM-4212] - JMS feature does not work after cluster failover
+ * [JBSEAM-4223] - Error page is called relative to invoking URL
+ * [JBSEAM-4290] - jboss-el.jar version in MANIFEST.MF doesn't correspond with real version in maven repo - it applies for 1.0_02.CR3 and 1.0_02.CR4
+ * [JBSEAM-4316] - Classloader cannot find XML files in multiple WARs
+ * [JBSEAM-4321] - Typo "Exeception" in AsynchronousExceptionHandler message
+ * [JBSEAM-4332] - HTTP sessions expiration cause a "javax.naming.ConfigurationException" while trying to "Destroy" the EntityManager components in WebSphere
+ * [JBSEAM-4334] - Useless lock in Initialization.redeploy
+ * [JBSEAM-4340] - Seam blog example - throws IllegalStateException on undeploy
+ * [JBSEAM-4342] - RemotingTest.testMapWrapper() relies on undefined behavior
+ * [JBSEAM-4344] - testreport target does not pick up all test results on Windows
+ * [JBSEAM-4352] - Excel example should be placed in a separate package
+ * [JBSEAM-4360] - Prefix bug in Seam integration of RESTEasy
+ * [JBSEAM-4364] - Fix joystickSellingTest in seambay example ftest
+ * [JBSEAM-4400] - SeleniumDateSelector cannot be compiled with JDK 5
+ * [JBSEAM-4401] - Component locale-config (org.jboss.seam.international.localeConfig) does not set the locale things in JSF context if JSF is not initialized before Seam
+ * [JBSEAM-4402] - DBUnitSeamTest assumes @BeforeClass methods run in certain order
+ * [JBSEAM-4413] - Date format error in .page.xml params when having custom date pattern
+ * [JBSEAM-4451] - SeamGen WAR ftest uses wrong input
+ * [JBSEAM-4462] - Seam booking - outdated page footers
+ * [JBSEAM-4474] - Hibernate class org.hibernate.lob.ReaderInputStream is now org.hibernate.engine.jdbc.ReaderInputStream and that breaks Seam
+ * [JBSEAM-4482] - Sjsxp Maven dependency moved to another location in java.net repository
+ * [JBSEAM-4491] - ant target initresteasy is failing - dependency com/sun/xml/stream/sjsxp/1.0.1 is missing
+ * [JBSEAM-4495] - Page actions do not work with JSF 2.0
+ * [JBSEAM-4505] - SAX error when parsing Seam 2.1 s.tld - org.xml.sax.SAXException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'description'.
+ * [JBSEAM-4509] - EntityManager not injected on JBoss AS 6 M1
+ * [JBSEAM-4519] - Conditional navigation rules vs JSF 2.0
+ * [JBSEAM-4526] - Wrong navigation in Seamspace example
+ * [JBSEAM-4537] - s:validateEquality tag doesn't work with JBossAS 6.0.0.M1
+ * [JBSEAM-4539] - s:selectItems part of UI example doesn't work with JBossAS 6.0.0.M1
+ * [JBSEAM-4549] - NPE in handleInbound()when servlet contexts are initialized
+
+** Feature Request
+ * [JBSEAM-1572] - Make s:decorate behave more similarly to ui:decorate (h:panelGrid-friendly)
+ * [JBSEAM-2057] - Syntax highlighting
+ * [JBSEAM-2369] - Embedding custom fonts (TrueType, etc...) to the generated PDF file
+ * [JBSEAM-2578] - Provide support for creating bookmarks in pdf
+ * [JBSEAM-2852] - Scan for @WebRemote on extended Interfaces
+ * [JBSEAM-3685] - Add "rendered" attribute to s:decorate
+ * [JBSEAM-3752] - The possibility to kill the conversation stack with the "s:conversationPropagation" tag is missing
+ * [JBSEAM-3987] - Integrate RESTEasy with Seam Application fwk for easy CRUD
+ * [JBSEAM-4186] - Bundle remoting resources as path parameters of interface.js GET request
+ * [JBSEAM-4325] - ResourceLoader, moving from JBoss 4 to JBoss 5, page level messages.properties not workin any more.
+ * [JBSEAM-4339] - add JMX lookup component
+ * [JBSEAM-4383] - Implement supporting infrastructure for HTTP optimization
+ * [JBSEAM-4403] - Create an eclipseclasspath ant target for examples
+ * [JBSEAM-4453] - seam script in distribution should have executable permission set
+ * [JBSEAM-4493] - add right to left character support
+ * [JBSEAM-4501] - Wiki registration spam protection
+ * [JBSEAM-4517] - Add Support to create New Page for Chapter/Section in PDF
+ * [JBSEAM-4518] - Create an automated test for testing failover of booking example in a cluster
+ * [JBSEAM-4525] - Allow FacesMessages component to be Scope other than CONVERSATION
+ * [JBSEAM-4552] - AbstractMethodError thrown when attempting to invoke JPA 2 method on EntityManager
+
+** Patch
+ * [JBSEAM-4036] - Wicket Example - Missing jars in tomcat.deploy ant task
+ * [JBSEAM-4455] - Seamspace -- viewIds in s:link and s:button
+
+** Task
+ * [JBSEAM-3035] - upgrade to Spring JAR to version 2.5
+ * [JBSEAM-3714] - Update release-process.txt to include the functional test execution
+ * [JBSEAM-3727] - Create an eclipse project and ant task for functional tests
+ * [JBSEAM-3776] - Update release-process with cluster testing steps
+ * [JBSEAM-4048] - Upgrade Seam to use RichFaces 3.3.1
+ * [JBSEAM-4240] - Duplicate class name AbstractResource in two packages
+ * [JBSEAM-4247] - Remove Seam component support for JAX RS providers
+ * [JBSEAM-4293] - Make JBoss restart after a specified number of ftests run to prevent OutOfMemoryError
+ * [JBSEAM-4324] - Adapt the jee5/booking sample application to run smoothly on WebSphere v7 and review the WebSphere chapter in the doc
+ * [JBSEAM-4331] - Upgrade xstream dependency
+ * [JBSEAM-4353] - Create functional test for Guice example
+ * [JBSEAM-4355] - Create a testcase for seamspace example
+ * [JBSEAM-4356] - Creation of a functional test for remoting/helloworld example
+ * [JBSEAM-4359] - Create a functional test for remoting/gwt example
+ * [JBSEAM-4361] - update jfreechart
+ * [JBSEAM-4362] - Create automated test for OpenID seam feature
+ * [JBSEAM-4363] - Extend Seambay example ftest
+ * [JBSEAM-4365] - Create a selenium test for UI example
+ * [JBSEAM-4366] - Create a testcase for web service test page of seambay example
+ * [JBSEAM-4372] - Fixed joystickSellingTest of seambay example
+ * [JBSEAM-4386] - Create a functional test for UI example
+ * [JBSEAM-4406] - ResteasyBootstrap should use @Install(precedence=BUILT_IN)
+ * [JBSEAM-4412] - Create automated test for OpenID seam feature
+ * [JBSEAM-4414] - Create a functional test for chatroom example
+ * [JBSEAM-4416] - Fix a functional test of seam UI example
+ * [JBSEAM-4418] - Create a functional test for chatroom example
+ * [JBSEAM-4423] - Modify functional tests to log more debugging information
+ * [JBSEAM-4430] - Replace ftest libraries with maven dependencies
+ * [JBSEAM-4437] - Create a testcase for JBSEAM-3866
+ * [JBSEAM-4445] - Use rutime.exec to call ant targets in functional tests
+ * [JBSEAM-4492] - Upgrade resteasy to last available release
+ * [JBSEAM-4498] - Upgrade Hibernate libs in wiki
+ * [JBSEAM-4499] - Improve wiki data model/schema
+ * [JBSEAM-4524] - Create a functional test for mail example
+ * [JBSEAM-4533] - Modify navigation rules in Seam examples to work with JSF 2.0
+ * [JBSEAM-4534] - Upgrade Richfaces to 3.3.3
+ * [JBSEAM-4541] - Remote webservices invocation in Seambay should inform about of state of request by a JavaScript flag
+
+
Release Notes - Seam - Version 2.2.0.GA
** Bug
Modified: branches/community/Seam_2_2/readme.txt
===================================================================
--- branches/community/Seam_2_2/readme.txt 2010-02-23 20:35:56 UTC (rev 12070)
+++ branches/community/Seam_2_2/readme.txt 2010-02-24 09:11:51 UTC (rev 12071)
@@ -1,7 +1,7 @@
JBoss Seam - Contextual Component framework for Java EE 5
=========================================================
-version 2.2.0.GA, July 2009
+version 2.2.1.CR1, February 2010
This software is distributed under the terms of the FSF Lesser Gnu
Public License (see lgpl.txt).
14 years, 10 months
Seam SVN: r12070 - branches/community/Seam_2_2/src/main/org/jboss/seam/persistence.
by seam-commits@lists.jboss.org
Author: youngm
Date: 2010-02-23 15:35:56 -0500 (Tue, 23 Feb 2010)
New Revision: 12070
Added:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerInvocationHandler.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionInvocationHandler.java
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/PersistenceProvider.java
Log:
JBSEAM-4552
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/AbstractPersistenceProvider.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -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;
@@ -110,7 +111,9 @@
*/
public EntityManager proxyEntityManager(EntityManager entityManager)
{
- return new EntityManagerProxy(entityManager);
+ return (EntityManager) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { EntityManagerProxy.class },
+ new EntityManagerInvocationHandler(entityManager));
}
/**
Added: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerInvocationHandler.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerInvocationHandler.java (rev 0)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerInvocationHandler.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -0,0 +1,93 @@
+package org.jboss.seam.persistence;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+
+import org.jboss.seam.security.permission.PermissionManager;
+
+/**
+ * InvocationHandler that Proxies the EntityManager, and implements EL
+ * interpolation in JPA-QL
+ *
+ * @author Gavin King
+ * @author Mike Youngstrom
+ */
+public class EntityManagerInvocationHandler implements InvocationHandler
+{
+
+ private EntityManager delegate;
+
+ public EntityManagerInvocationHandler(EntityManager delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ try
+ {
+ if ("createQuery".equals(method.getName()) && method.getParameterTypes().length > 0 && method.getParameterTypes()[0].equals(String.class))
+ {
+ return handleCreateQueryWithString(method, args);
+ }
+ if ("getDelegate".equals(method.getName()))
+ {
+ return handleGetDelegate(method, args);
+ }
+ if ("remove".equals(method.getName()) && method.getParameterTypes().length > 0)
+ {
+ return handleRemove(method, args);
+ }
+ return method.invoke(delegate, args);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getTargetException();
+ }
+ }
+
+ protected Object handleCreateQueryWithString(Method method, Object[] args) throws Throwable
+ {
+ if (args[0] == null)
+ {
+ return method.invoke(delegate, args);
+ }
+ String ejbql = (String) args[0];
+ if (ejbql.indexOf('#') > 0)
+ {
+ QueryParser qp = new QueryParser(ejbql);
+ Object[] newArgs = args.clone();
+ newArgs[0] = qp.getEjbql();
+ Query query = (Query) method.invoke(delegate, newArgs);
+ for (int i = 0; i < qp.getParameterValueBindings().size(); i++)
+ {
+ query.setParameter(QueryParser.getParameterName(i), qp.getParameterValueBindings().get(i).getValue());
+ }
+ return query;
+ }
+ else
+ {
+ return method.invoke(delegate, args);
+ }
+ }
+
+ protected Object handleGetDelegate(Method method, Object[] args) throws Throwable
+ {
+ return PersistenceProvider.instance().proxyDelegate(method.invoke(delegate, args));
+ }
+
+ protected Object handleRemove(Method method, Object[] args) throws Throwable
+ {
+ if (args.length == 0)
+ {
+ return method.invoke(delegate, args);
+ }
+ Object result = method.invoke(delegate, args);
+ PermissionManager.instance().clearPermissions(args[0]);
+ return result;
+ }
+}
Property changes on: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerInvocationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerProxy.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/EntityManagerProxy.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -3,13 +3,7 @@
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;
-
/**
* Proxies the EntityManager, and implements EL interpolation
* in JPA-QL
@@ -17,139 +11,6 @@
* @author Gavin King
*
*/
-public class EntityManagerProxy implements EntityManager, Serializable
+public interface EntityManagerProxy extends EntityManager, Serializable
{
- private EntityManager delegate;
-
- public EntityManagerProxy(EntityManager 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 = delegate.createQuery( qp.getEjbql() );
- for (int i=0; i<qp.getParameterValueBindings().size(); i++)
- {
- query.setParameter(
- QueryParser.getParameterName(i),
- qp.getParameterValueBindings().get(i).getValue()
- );
- }
- return query;
- }
- else
- {
- return delegate.createQuery(ejbql);
- }
- }
-
- public <T> T find(Class<T> clazz, Object id)
- {
- 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)
- {
- delegate.remove(entity);
- PermissionManager.instance().clearPermissions(entity);
- }
-
- public void setFlushMode(FlushModeType fm)
- {
- delegate.setFlushMode(fm);
- }
}
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextEntityManagerProxy.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -1,57 +1,17 @@
//$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;
/**
- * Wrap a FullTextEntityManager
+ * Marker Interface here to show that a given EntityManager is doing EL
+ * manipulation and for backwards compatibility with previous non proxy
+ * solution.
*
* @author Emmanuel Bernard
* @author Sanne Grinovero
+ * @author Mike Youngstrom
*/
-public class FullTextEntityManagerProxy extends EntityManagerProxy implements FullTextEntityManager
+public interface FullTextEntityManagerProxy extends EntityManagerProxy, FullTextEntityManager
{
-
- private final 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 flushToIndexes()
- {
- fullTextEntityManager.flushToIndexes();
- }
-
- public <T> void index(T entity)
- {
- fullTextEntityManager.index(entity);
- }
-
- public SearchFactory getSearchFactory()
- {
- return fullTextEntityManager.getSearchFactory();
- }
-
- public <T> void purge(Class<T> aClass, Serializable id)
- {
- fullTextEntityManager.purge(aClass, id);
- }
-
- public <T> void purgeAll(Class<T> entityType)
- {
- fullTextEntityManager.purgeAll(entityType);
- }
}
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/FullTextHibernateSessionProxy.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -1,179 +1,16 @@
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.jdbc.Work;
-import org.hibernate.search.FullTextQuery;
import org.hibernate.search.FullTextSession;
-import org.hibernate.search.SearchFactory;
-import org.hibernate.type.Type;
/**
- * Wraps a Hibernate Search session
+ * Marker Interface here to show that a given EntityManager is doing EL
+ * manipulation and for backwards compatibility with previous non proxy
+ * solution.
*
* @author Gavin King
* @author Sanne Grinovero
+ * @author Mike Youngstrom
*/
-@SuppressWarnings("deprecation")
-public class FullTextHibernateSessionProxy extends HibernateSessionProxy implements FullTextSession
+public interface FullTextHibernateSessionProxy extends HibernateSessionProxy, FullTextSession
{
- private FullTextSession fullTextSession;
-
- public FullTextHibernateSessionProxy(FullTextSession fullTextSession)
- {
- super(fullTextSession);
- this.fullTextSession = fullTextSession;
- }
-
- public <T> void index(T entity)
- {
- fullTextSession.index(entity);
- }
-
- public FullTextQuery createFullTextQuery(org.apache.lucene.search.Query ftQuery, Class<?>... entityTypes)
- {
- return fullTextSession.createFullTextQuery(ftQuery, entityTypes);
- }
-
- 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 void doWork(Work work) throws HibernateException
- {
- fullTextSession.doWork(work);
- }
-
- public void flushToIndexes()
- {
- fullTextSession.flushToIndexes();
- }
-
- 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 <T> void purge(Class<T> entityType, Serializable id)
- {
- fullTextSession.purge(entityType, id);
- }
-
- public <T> void purgeAll(Class<T> 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: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernatePersistenceProvider.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -1,9 +1,9 @@
package org.jboss.seam.persistence;
import static org.jboss.seam.annotations.Install.FRAMEWORK;
-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;
@@ -47,9 +47,9 @@
{
private static Log log = Logging.getLog(HibernatePersistenceProvider.class);
- private static Constructor FULL_TEXT_SESSION_PROXY_CONSTRUCTOR;
+ private static Class FULL_TEXT_SESSION_PROXY_CLASS;
private static Method FULL_TEXT_SESSION_CONSTRUCTOR;
- private static Constructor FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR;
+ private static Class FULL_TEXT_ENTITYMANAGER_PROXY_CLASS;
private static Method FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR;
static
{
@@ -74,9 +74,7 @@
log.debug("org.hibernate.search.Search.getFullTextSession(Session) not found, trying deprecated method name createFullTextSession");
FULL_TEXT_SESSION_CONSTRUCTOR = searchClass.getDeclaredMethod("createFullTextSession", Session.class);
}
- Class fullTextSessionProxyClass = Class.forName("org.jboss.seam.persistence.FullTextHibernateSessionProxy");
- Class fullTextSessionClass = Class.forName("org.hibernate.search.FullTextSession");
- FULL_TEXT_SESSION_PROXY_CONSTRUCTOR = fullTextSessionProxyClass.getDeclaredConstructor(fullTextSessionClass);
+ FULL_TEXT_SESSION_PROXY_CLASS = Class.forName("org.jboss.seam.persistence.FullTextHibernateSessionProxy");
Class jpaSearchClass = Class.forName("org.hibernate.search.jpa.Search");
try {
FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR = jpaSearchClass.getDeclaredMethod("getFullTextEntityManager", EntityManager.class);
@@ -85,9 +83,7 @@
log.debug("org.hibernate.search.jpa.getFullTextSession(EntityManager) not found, trying deprecated method name createFullTextEntityManager");
FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR = jpaSearchClass.getDeclaredMethod("createFullTextEntityManager", EntityManager.class);
}
- Class fullTextEntityManagerProxyClass = Class.forName("org.jboss.seam.persistence.FullTextEntityManagerProxy");
- Class fullTextEntityManagerClass = Class.forName("org.hibernate.search.jpa.FullTextEntityManager");
- FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR = fullTextEntityManagerProxyClass.getDeclaredConstructor(fullTextEntityManagerClass);
+ FULL_TEXT_ENTITYMANAGER_PROXY_CLASS = Class.forName("org.jboss.seam.persistence.FullTextEntityManagerProxy");
log.debug("Hibernate Search is available :-)");
}
}
@@ -111,18 +107,24 @@
*/
static Session proxySession(Session session)
{
- if (FULL_TEXT_SESSION_PROXY_CONSTRUCTOR==null)
+ if (FULL_TEXT_SESSION_PROXY_CLASS==null)
{
- return new HibernateSessionProxy(session);
+ return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { HibernateSessionProxy.class },
+ new HibernateSessionInvocationHandler(session));
}
else
{
try {
- return (Session) FULL_TEXT_SESSION_PROXY_CONSTRUCTOR.newInstance( FULL_TEXT_SESSION_CONSTRUCTOR.invoke(null, session) );
+ return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { FULL_TEXT_SESSION_PROXY_CLASS },
+ new HibernateSessionInvocationHandler((Session) FULL_TEXT_SESSION_CONSTRUCTOR.invoke(null, session)));
}
catch(Exception e) {
log.warn("Unable to wrap into a FullTextSessionProxy, regular SessionProxy returned", e);
- return new HibernateSessionProxy(session);
+ return (Session) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { HibernateSessionProxy.class },
+ new HibernateSessionInvocationHandler(session));
}
}
}
@@ -292,7 +294,7 @@
@Override
public EntityManager proxyEntityManager(EntityManager entityManager)
{
- if (FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR==null)
+ if (FULL_TEXT_ENTITYMANAGER_PROXY_CLASS==null)
{
return super.proxyEntityManager(entityManager);
}
@@ -300,11 +302,12 @@
{
try
{
- return (EntityManager) FULL_TEXT_ENTITYMANAGER_PROXY_CONSTRUCTOR.newInstance(
- FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null, super.proxyEntityManager( entityManager) )
- //TODO is double wrapping the right choice? ie to wrap the session?
- );
- }
+ return (EntityManager) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { FULL_TEXT_ENTITYMANAGER_PROXY_CLASS },
+ new EntityManagerInvocationHandler(
+ (EntityManager) FULL_TEXT_ENTITYMANAGER_CONSTRUCTOR.invoke(null,
+ super.proxyEntityManager(entityManager))));
+ }
catch (Exception e)
{
//throw new RuntimeException("could not proxy FullTextEntityManager", e);
Added: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionInvocationHandler.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionInvocationHandler.java (rev 0)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionInvocationHandler.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -0,0 +1,79 @@
+package org.jboss.seam.persistence;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+
+/**
+ * InvocationHandler that proxies the Session, and implements EL interpolation
+ * in HQL. Needs to implement SessionImplementor because DetachedCriteria casts
+ * the Session to SessionImplementor.
+ *
+ * @author Gavin King
+ * @author Emmanuel Bernard
+ * @author Mike Youngstrom
+ *
+ */
+public class HibernateSessionInvocationHandler implements InvocationHandler
+{
+
+ private Session delegate;
+
+ public HibernateSessionInvocationHandler(Session delegate)
+ {
+ this.delegate = delegate;
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ try
+ {
+ if ("createQuery".equals(method.getName()) && method.getParameterTypes().length > 0 && method.getParameterTypes()[0].equals(String.class))
+ {
+ return handleCreateQueryWithString(method, args);
+ }
+ if ("reconnect".equals(method.getName()) && method.getParameterTypes().length == 0)
+ {
+ return handleReconnectNoArg(method);
+ }
+ return method.invoke(delegate, args);
+ }
+ catch (InvocationTargetException e)
+ {
+ throw e.getTargetException();
+ }
+ }
+
+ protected Object handleCreateQueryWithString(Method method, Object[] args) throws Throwable
+ {
+ if (args[0] == null)
+ {
+ return method.invoke(delegate, args);
+ }
+ String ejbql = (String) args[0];
+ if (ejbql.indexOf('#') > 0)
+ {
+ QueryParser qp = new QueryParser(ejbql);
+ Object[] newArgs = args.clone();
+ newArgs[0] = qp.getEjbql();
+ Query query = (Query) method.invoke(delegate, newArgs);
+ for (int i = 0; i < qp.getParameterValueBindings().size(); i++)
+ {
+ query.setParameter(QueryParser.getParameterName(i), qp.getParameterValueBindings().get(i).getValue());
+ }
+ return query;
+ }
+ else
+ {
+ return method.invoke(delegate, args);
+ }
+ }
+
+ protected Object handleReconnectNoArg(Method method) throws Throwable
+ {
+ throw new UnsupportedOperationException("deprecated");
+ }
+}
Property changes on: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionInvocationHandler.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/HibernateSessionProxy.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -1,675 +1,20 @@
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.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;
-import org.hibernate.impl.CriteriaImpl;
-import org.hibernate.jdbc.Batcher;
-import org.hibernate.jdbc.JDBCContext;
-import org.hibernate.jdbc.Work;
-import org.hibernate.loader.custom.CustomQuery;
-import org.hibernate.persister.entity.EntityPersister;
-import org.hibernate.stat.SessionStatistics;
-import org.hibernate.type.Type;
/**
- * Proxies the Session, and implements EL interpolation
- * in HQL. Needs to implement SessionImplementor because
- * DetachedCriteria casts the Session to SessionImplementor.
+ * Marker interface that signifies a proxy is using the
+ * HibernateSessionInvocationHandler. Also here for backwards compatibility with
+ * previous HibernateSessionProxy.
*
* @author Gavin King
- * @author Emmanuel Bernard
- * FIXME: EventSource should not really be there, remove once HSearch is fixed
- *
+ * @author Emmanuel Bernard FIXME: EventSource should not really be there,
+ * remove once HSearch is fixed
+ * @author Mike Youngstrom
+ *
*/
-public class HibernateSessionProxy implements Session, SessionImplementor, EventSource
+public interface HibernateSessionProxy extends Session, SessionImplementor, EventSource
{
- private Session delegate;
-
- /**
- * Don't use that constructor directly, use HibernatePersistenceProvider.proxySession()
- */
- public HibernateSessionProxy(Session 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 = delegate.createQuery( qp.getEjbql() );
- for (int i=0; i<qp.getParameterValueBindings().size(); i++)
- {
- query.setParameter(
- QueryParser.getParameterName(i),
- qp.getParameterValueBindings().get(i).getValue()
- );
- }
- return query;
- }
- else
- {
- 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 void doWork(Work work) throws HibernateException
- {
- delegate.doWork(work);
- }
-
- 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;
- }
-
- private EventSource getDelegateEventSource()
- {
- return (EventSource) delegate;
- }
-
- public void afterScrollOperation()
- {
- getDelegateSessionImplementor().afterScrollOperation();
- }
-
- public void afterTransactionCompletion(boolean arg0, Transaction arg1)
- {
- getDelegateSessionImplementor().afterTransactionCompletion(arg0, arg1);
- }
-
- public void beforeTransactionCompletion(Transaction arg0)
- {
- getDelegateSessionImplementor().beforeTransactionCompletion(arg0);
- }
-
- public String bestGuessEntityName(Object arg0)
- {
- return getDelegateSessionImplementor().bestGuessEntityName(arg0);
- }
-
- public int executeNativeUpdate(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().executeNativeUpdate(arg0, arg1);
- }
-
- public int executeUpdate(String arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().executeUpdate(arg0, arg1);
- }
-
- public Batcher getBatcher()
- {
- return getDelegateSessionImplementor().getBatcher();
- }
-
- public Serializable getContextEntityIdentifier(Object arg0)
- {
- return getDelegateSessionImplementor().getContextEntityIdentifier(arg0);
- }
-
- public int getDontFlushFromFind()
- {
- return getDelegateSessionImplementor().getDontFlushFromFind();
- }
-
- public Map getEnabledFilters()
- {
- return getDelegateSessionImplementor().getEnabledFilters();
- }
-
- public EntityPersister getEntityPersister(String arg0, Object arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().getEntityPersister(arg0, arg1);
- }
-
- public Object getEntityUsingInterceptor(EntityKey arg0) throws HibernateException
- {
- return getDelegateSessionImplementor().getEntityUsingInterceptor(arg0);
- }
-
- public SessionFactoryImplementor getFactory()
- {
- return getDelegateSessionImplementor().getFactory();
- }
-
- public String getFetchProfile()
- {
- return getDelegateSessionImplementor().getFetchProfile();
- }
-
- public Type getFilterParameterType(String arg0)
- {
- return getDelegateSessionImplementor().getFilterParameterType(arg0);
- }
-
- public Object getFilterParameterValue(String arg0)
- {
- return getDelegateSessionImplementor().getFilterParameterValue(arg0);
- }
-
- public Interceptor getInterceptor()
- {
- return getDelegateSessionImplementor().getInterceptor();
- }
-
- public JDBCContext getJDBCContext()
- {
- return getDelegateSessionImplementor().getJDBCContext();
- }
-
- public EventListeners getListeners()
- {
- return getDelegateSessionImplementor().getListeners();
- }
-
- public Query getNamedSQLQuery(String arg0)
- {
- return getDelegateSessionImplementor().getNamedSQLQuery(arg0);
- }
-
- public PersistenceContext getPersistenceContext()
- {
- return getDelegateSessionImplementor().getPersistenceContext();
- }
-
- public long getTimestamp()
- {
- return getDelegateSessionImplementor().getTimestamp();
- }
-
- public String guessEntityName(Object arg0) throws HibernateException
- {
- return getDelegateSessionImplementor().guessEntityName(arg0);
- }
-
- public Object immediateLoad(String arg0, Serializable arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().immediateLoad(arg0, arg1);
- }
-
- public void initializeCollection(PersistentCollection arg0, boolean arg1) throws HibernateException
- {
- getDelegateSessionImplementor().initializeCollection(arg0, arg1);
- }
-
- public Object instantiate(String arg0, Serializable arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().instantiate(arg0, arg1);
- }
-
- public Object internalLoad(String arg0, Serializable arg1, boolean arg2, boolean arg3) throws HibernateException
- {
- return getDelegateSessionImplementor().internalLoad(arg0, arg1, arg2, arg3);
- }
-
- public boolean isClosed()
- {
- return getDelegateSessionImplementor().isClosed();
- }
-
- public boolean isEventSource()
- {
- return getDelegateSessionImplementor().isEventSource();
- }
-
- public boolean isTransactionInProgress()
- {
- return getDelegateSessionImplementor().isTransactionInProgress();
- }
-
- public Iterator iterate(String arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().iterate(arg0, arg1);
- }
-
- public Iterator iterateFilter(Object arg0, String arg1, QueryParameters arg2) throws HibernateException
- {
- return getDelegateSessionImplementor().iterateFilter(arg0, arg1, arg2);
- }
-
- public List list(CriteriaImpl arg0)
- {
- return getDelegateSessionImplementor().list(arg0);
- }
-
- public List list(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().list(arg0, arg1);
- }
-
- public List list(String arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().list(arg0, arg1);
- }
-
- public List listCustomQuery(CustomQuery arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().listCustomQuery(arg0, arg1);
- }
-
- public List listFilter(Object arg0, String arg1, QueryParameters arg2) throws HibernateException
- {
- return getDelegateSessionImplementor().listFilter(arg0, arg1, arg2);
- }
-
- public ScrollableResults scroll(CriteriaImpl arg0, ScrollMode arg1)
- {
- return getDelegateSessionImplementor().scroll(arg0, arg1);
- }
-
- public ScrollableResults scroll(NativeSQLQuerySpecification arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().scroll(arg0, arg1);
- }
-
- public ScrollableResults scroll(String arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().scroll(arg0, arg1);
- }
-
- public ScrollableResults scrollCustomQuery(CustomQuery arg0, QueryParameters arg1) throws HibernateException
- {
- return getDelegateSessionImplementor().scrollCustomQuery(arg0, arg1);
- }
-
- public void setAutoClear(boolean arg0)
- {
- getDelegateSessionImplementor().setAutoClear(arg0);
- }
-
- public void setFetchProfile(String arg0)
- {
- getDelegateSessionImplementor().setFetchProfile(arg0);
- }
-
- public ActionQueue getActionQueue() {
- return getDelegateEventSource().getActionQueue();
- }
-
- public Object instantiate(EntityPersister entityPersister, Serializable serializable) throws HibernateException {
- return getDelegateEventSource().instantiate( entityPersister, serializable );
- }
-
- public void forceFlush(EntityEntry entityEntry) throws HibernateException {
- getDelegateEventSource().forceFlush( entityEntry );
- }
-
- public void merge(String s, Object o, Map map) throws HibernateException {
- getDelegateEventSource().merge( s, o, map );
- }
-
- public void persist(String s, Object o, Map map) throws HibernateException {
- getDelegateEventSource().persist( s, o, map );
- }
-
- public void persistOnFlush(String s, Object o, Map map) {
- getDelegateEventSource().persistOnFlush( s, o, map );
- }
-
- public void refresh(Object o, Map map) throws HibernateException {
- getDelegateEventSource().refresh( o, map );
- }
-
- public void saveOrUpdateCopy(String s, Object o, Map map) throws HibernateException {
- getDelegateEventSource().saveOrUpdateCopy( s, o , map );
- }
-
- public void delete(String s, Object o, boolean b, Set set) {
- getDelegateEventSource().delete( s, o, b, set );
- }
}
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/PersistenceProvider.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2010-02-23 19:52:51 UTC (rev 12069)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/persistence/PersistenceProvider.java 2010-02-23 20:35:56 UTC (rev 12070)
@@ -3,6 +3,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 java.util.HashSet;
import java.util.Set;
@@ -216,7 +217,9 @@
*/
public EntityManager proxyEntityManager(EntityManager entityManager)
{
- return new EntityManagerProxy(entityManager);
+ return (EntityManager) Proxy.newProxyInstance(Thread.currentThread().getContextClassLoader(),
+ new Class[] { EntityManagerProxy.class },
+ new EntityManagerInvocationHandler(entityManager));
}
/**
14 years, 10 months
Seam SVN: r12069 - branches/community/Seam_2_2/examples/ui/view.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-23 14:52:51 -0500 (Tue, 23 Feb 2010)
New Revision: 12069
Modified:
branches/community/Seam_2_2/examples/ui/view/selectItems.xhtml
Log:
workaround JBSEAM-4539
Modified: branches/community/Seam_2_2/examples/ui/view/selectItems.xhtml
===================================================================
--- branches/community/Seam_2_2/examples/ui/view/selectItems.xhtml 2010-02-22 09:44:32 UTC (rev 12068)
+++ branches/community/Seam_2_2/examples/ui/view/selectItems.xhtml 2010-02-23 19:52:51 UTC (rev 12069)
@@ -55,7 +55,7 @@
<s:decorate template="decorateField.xhtml">
<ui:define name="label">Roles</ui:define>
- <h:selectManyCheckbox value="#{person.roles}" required="true">
+ <h:selectManyCheckbox value="#{person.roles}" required="true" collectionType="java.util.ArrayList">
<s:selectItems value="#{roles}" var="role" label="#{role.name}"/>
<s:convertEnum />
</h:selectManyCheckbox>
@@ -81,7 +81,7 @@
<s:decorate template="decorateField.xhtml">
<ui:define name="label">Favourite Colours</ui:define>
<ui:define name="description">A colour is an entity</ui:define>
- <h:selectManyListbox value="#{personHome.instance.favouriteColours}" >
+ <h:selectManyListbox value="#{personHome.instance.favouriteColours}" collectionType="java.util.ArrayList">
<s:selectItems value="#{colours.resultList}" var="colour" label="#{colour.name}" />
<s:convertEntity />
</h:selectManyListbox>
14 years, 10 months
Seam SVN: r12068 - modules/remoting/trunk/docs.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-22 04:44:32 -0500 (Mon, 22 Feb 2010)
New Revision: 12068
Modified:
modules/remoting/trunk/docs/
Log:
ignores
Property changes on: modules/remoting/trunk/docs
___________________________________________________________________
Name: svn:ignore
+ remoting-reference.pdf
target
14 years, 10 months
Seam SVN: r12067 - modules/security/trunk.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-02-22 04:41:52 -0500 (Mon, 22 Feb 2010)
New Revision: 12067
Modified:
modules/security/trunk/pom.xml
Log:
use pre-reqs in POM to enforce Maven 2.0.10
Modified: modules/security/trunk/pom.xml
===================================================================
--- modules/security/trunk/pom.xml 2010-02-20 22:19:00 UTC (rev 12066)
+++ modules/security/trunk/pom.xml 2010-02-22 09:41:52 UTC (rev 12067)
@@ -30,6 +30,11 @@
</repository>
</repositories>
+ <prerequisites>
+ <maven>2.0.10</maven>
+ </prerequisites>
+
+
<properties>
<seam.version>3.0.0-SNAPSHOT</seam.version>
</properties>
14 years, 10 months
Seam SVN: r12066 - branches/community/Seam_2_2/build.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-02-20 17:19:00 -0500 (Sat, 20 Feb 2010)
New Revision: 12066
Modified:
branches/community/Seam_2_2/build/root.pom.xml
branches/community/Seam_2_2/build/ui.pom.xml
Log:
JBSEAM-4534 - upgrade of RIchfaces to 3.3.3.CR1
Modified: branches/community/Seam_2_2/build/root.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/root.pom.xml 2010-02-19 23:28:16 UTC (rev 12065)
+++ branches/community/Seam_2_2/build/root.pom.xml 2010-02-20 22:19:00 UTC (rev 12066)
@@ -38,7 +38,7 @@
<!-- Externalize some version numbers here -->
<properties>
- <version.richfaces>3.3.1.GA</version.richfaces>
+ <version.richfaces>3.3.3.CR1</version.richfaces>
<version.wicket>1.3.5.jboss1</version.wicket>
<version.drools>5.0.1</version.drools>
<version.testng>5.9</version.testng>
Modified: branches/community/Seam_2_2/build/ui.pom.xml
===================================================================
--- branches/community/Seam_2_2/build/ui.pom.xml 2010-02-19 23:28:16 UTC (rev 12065)
+++ branches/community/Seam_2_2/build/ui.pom.xml 2010-02-20 22:19:00 UTC (rev 12066)
@@ -103,6 +103,12 @@
<artifactId>richfaces-ui</artifactId>
<optional>true</optional>
</dependency>
+
+ <dependency>
+ <groupId>org.richfaces.framework</groupId>
+ <artifactId>richfaces-impl</artifactId>
+ <optional>true</optional>
+ </dependency>
<!-- Maven's "nearest" dependency resolution doesn't take into account parent dependency management! -->
<dependency>
14 years, 11 months
Seam SVN: r12065 - branches/community/Seam_2_2/src/main/org/jboss/seam/webservice.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-02-19 18:28:16 -0500 (Fri, 19 Feb 2010)
New Revision: 12065
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/webservice/SOAPRequestHandler.java
Log:
JBSEAM-4549 - fixed getting servlet context
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/webservice/SOAPRequestHandler.java
===================================================================
--- branches/community/Seam_2_2/src/main/org/jboss/seam/webservice/SOAPRequestHandler.java 2010-02-19 15:49:52 UTC (rev 12064)
+++ branches/community/Seam_2_2/src/main/org/jboss/seam/webservice/SOAPRequestHandler.java 2010-02-19 23:28:16 UTC (rev 12065)
@@ -68,7 +68,7 @@
try
{
HttpServletRequest request = (HttpServletRequest) messageContext.get(MessageContext.SERVLET_REQUEST);
- ServletLifecycle.beginRequest(request);
+ ServletLifecycle.beginRequest(request, ServletLifecycle.getServletContext());
ServletContexts.instance().setRequest(request);
14 years, 11 months
Seam SVN: r12064 - branches/community/Seam_2_2/seam-gen/view/layout.
by seam-commits@lists.jboss.org
Author: manaRH
Date: 2010-02-19 10:49:52 -0500 (Fri, 19 Feb 2010)
New Revision: 12064
Modified:
branches/community/Seam_2_2/seam-gen/view/layout/template.xhtml
Log:
JBSEAM-4543 - fixed path to richfaces stylesheet in seam-gen template.xhtml
Modified: branches/community/Seam_2_2/seam-gen/view/layout/template.xhtml
===================================================================
--- branches/community/Seam_2_2/seam-gen/view/layout/template.xhtml 2010-02-19 15:02:17 UTC (rev 12063)
+++ branches/community/Seam_2_2/seam-gen/view/layout/template.xhtml 2010-02-19 15:49:52 UTC (rev 12064)
@@ -12,7 +12,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>@projectName@</title>
<link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
- <a:loadStyle src="resource:///stylesheet/theme.xcss"/>
+ <a:loadStyle src="/stylesheet/theme.xcss"/>
<a:loadStyle src="/stylesheet/theme.css"/>
<ui:insert name="head"/>
</head>
14 years, 11 months
Seam SVN: r12062 - in modules/xml/trunk/docs: en-US and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-02-18 23:02:28 -0500 (Thu, 18 Feb 2010)
New Revision: 12062
Added:
modules/xml/trunk/docs/README.TXT
modules/xml/trunk/docs/en-US/
modules/xml/trunk/docs/en-US/master.xml
modules/xml/trunk/docs/en-US/xml-general.xml
Removed:
modules/xml/trunk/docs/src/main/docbook/
modules/xml/trunk/docs/src/main/en-US/
Modified:
modules/xml/trunk/docs/pom.xml
Log:
Added the start of the seam-xml docs
Added: modules/xml/trunk/docs/README.TXT
===================================================================
--- modules/xml/trunk/docs/README.TXT (rev 0)
+++ modules/xml/trunk/docs/README.TXT 2010-02-19 04:02:28 UTC (rev 12062)
@@ -0,0 +1,3 @@
+To build the Seam XML docs run the following command:
+
+mvn jdocbook:generate
Added: modules/xml/trunk/docs/en-US/master.xml
===================================================================
--- modules/xml/trunk/docs/en-US/master.xml (rev 0)
+++ modules/xml/trunk/docs/en-US/master.xml 2010-02-19 04:02:28 UTC (rev 12062)
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding="utf-8"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
+ "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [ ]>
+<book lang="en">
+
+ <toc/>
+
+ <title>Seam XML Configuration</title>
+ <xi:include href="xml-general.xml" xmlns:xi="http://www.w3.org/2001/XInclude" />
+
+</book>
\ No newline at end of file
Added: modules/xml/trunk/docs/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/en-US/xml-general.xml (rev 0)
+++ modules/xml/trunk/docs/en-US/xml-general.xml 2010-02-19 04:02:28 UTC (rev 12062)
@@ -0,0 +1,326 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd">
+
+<chapter id="remoting">
+ <title>Seam XML General</title>
+
+ <para>Seam provides a method for configuring JSR-299 beans using XML. By default the XML configuration defines new beans,
+ it does not change existing beans.
+ </para>
+
+ <section>
+ <title>Configuration</title>
+ <para>No special configuration is required to use seam-xml, all that is required is to include the jar file in your delpoyment. </para>
+ </section>
+
+ <section>
+ <title>Getting Started</title>
+ <para>By default XML files are discovered from the classpath. The extension looks for an XML file named <literal>seam-bean.xml</literal> in the following locations: </para>
+ <itemizedlist>
+ <listitem><para>The root of an archive</para></listitem>
+ <listitem><para><literal>WEB-INF</literal></para></listitem>
+ <listitem><para><literal>META-INF</literal></para></listitem>
+ </itemizedlist>
+
+ <para>Lets start with a simple example</para>
+ <programlisting>
+ <![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<Beans xmlns="urn:seam:core"
+ xmlns:test="urn:java:org.jboss.seam.xml.test.injection">
+
+ <test:ProducerQualifier>
+ <Qualifier/>
+ </test:ProducerQualifier>
+
+ <test:ProducerBean>
+ <test:value>
+ <Produces/>
+ <test:ProducerQualifier/>
+ <value>hello world</value>
+ </test:value>
+ </test:ProducerBean>
+
+ <test:RecieverBean>
+ <test:value>
+ <test:ProducerQualifier/>
+ <Inject/>
+ </test:value>
+ </test:RecieverBean>
+
+</Beans>
+ ]]>
+ </programlisting>
+ <para>From the top:</para>
+
+
+ <para>The root element of the file has to be <literal><Beans/></literal>, and the root namespace should be <literal>urn:seam:core</literal>.
+ You will also notice that there is a second namespace defined, <literal>urn:java:org.jboss.seam.xml.test.injection</literal>, this namespace is used
+ to resolve classes in the java package <literal>org.jboss.seam.xml.test.injection</literal>.</para>
+ <programlisting>
+ <![CDATA[
+<test:ProducerQualifier>
+ <Qualifier/>
+</test:ProducerQualifier>
+ ]]>
+ </programlisting>
+
+ <para>The first entry in the file defines a new qualifier. <literal>ProducerQualifier</literal> is an annotation in the package <literal>org.jboss.seam.xml.test.injection</literal>.</para>
+
+ <programlisting>
+ <![CDATA[
+<test:ProducerBean>
+ <test:value>
+ <Produces/>
+ <test:ProducerQualifier/>
+ <value>hello world</value>
+ </test:value>
+</test:ProducerBean>
+ ]]>
+ </programlisting>
+
+ <para>The next entry in the file is a bean declaration. The bean class is <literal>org.jboss.seam.xml.test.injection.ProducerBean</literal>.
+ It is important to note that this declaration does not change the existing declaration of ProducerBean, instead it installs a new bean. In
+ this instance there will be two ProducerBean CDI beans.</para>
+
+ <para>This bean has a field called 'value', this field is configured to be a producer field using XML (it is also possible to configure producer
+ methods, more on this later). The <literal><test:value/></literal> declaration has several child elements. The <literal><Produces/></literal>
+ element tells the container that this is a producer field. <literal><test:ProducerQualifier/></literal> element defines a qualifier for the producer
+ field. The <literal><value></literal> element defines an initial value for the field.</para>
+
+ <para>Child elements of fields, methods and classes that resolve to Annotation types are considered to be annotations on the corresponding element,
+ so the corresponding java declaration for the XML above would be:</para>
+
+ <programlisting>
+ <![CDATA[
+public class ProducerBean
+{
+ @Produces
+ @ProducerQualifier
+ public String value = "hello world";
+}
+ ]]>
+ </programlisting>
+ <programlisting>
+ <![CDATA[
+<test:RecieverBean>
+ <test:value>
+ <test:ProducerQualifier/>
+ <Inject/>
+ </test:value>
+</test:RecieverBean>
+ ]]>
+ </programlisting>
+
+ <para>The XML above declares a new Bean that injects the value that was produced above. In this case the <literal>@Inject</literal> annotation is applied instead of
+ <literal>@Produces</literal> and no initial value is set.</para>
+ </section>
+
+ <section>
+ <title>The root namespace</title>
+ <para>The root namesapce can contain the following elements:</para>
+
+ <itemizedlist>
+ <listitem><para><literal>Beans</literal></para></listitem>
+ <listitem><para><literal>veto</literal></para></listitem>
+ <listitem><para><literal>value</literal></para></listitem>
+ <listitem><para><literal>key</literal></para></listitem>
+ <listitem><para><literal>entry</literal></para></listitem>
+ <listitem><para><literal>array</literal></para></listitem>
+ <listitem><para><literal>e</literal> (alias for entry)</para></listitem>
+ <listitem><para><literal>v</literal> (alias for value)</para></listitem>
+ <listitem><para><literal>k</literal> (alias for key)</para></listitem>
+ </itemizedlist>
+
+ <para>as well as classes from the following packages:</para>
+
+ <itemizedlist>
+ <listitem><para><literal>java.lang</literal></para></listitem>
+ <listitem><para><literal>java.util</literal></para></listitem>
+ <listitem><para><literal>javax.annotation</literal></para></listitem>
+ <listitem><para><literal>javax.inject</literal></para></listitem>
+ <listitem><para><literal>javax.enterprise.inject</literal></para></listitem>
+ <listitem><para><literal>javax.enterprise.context</literal></para></listitem>
+ <listitem><para><literal>javax.enterprise.event</literal></para></listitem>
+ <listitem><para><literal>javax.decorator</literal></para></listitem>
+ <listitem><para><literal>javax.interceptor</literal></para></listitem>
+ <listitem><para><literal>javax.persistence</literal></para></listitem>
+ <listitem><para><literal>javax.xml.ws</literal></para></listitem>
+ <listitem><para><literal>javax.jms</literal></para></listitem>
+ <listitem><para><literal>javax.sql</literal></para></listitem>
+ </itemizedlist>
+
+ <para>So the <literal><Produces></literal> element above actually resolved to <literal>java.enterprise.inject.Produces</literal>
+ and the <literal><Inject></literal> element resolved to <literal>javax.inject.Inject</literal>.</para>
+
+ </section>
+
+ <section>
+ <title>Replacing existing bean declarations</title>
+ <para>It is possible to prevent an existing bean being installed using the <literal><veto/></literal> tag:</para>
+ <programlisting>
+ <![CDATA[
+<veto>
+ <test:ProducerBean/>
+ <test:RecieverBean/>
+</veto>
+ ]]>
+ </programlisting>
+ <para>The code above would prevent the <literal>ProducerBean</literal> and <literal>RecieverBean</literal> that was discovered in the bean discovery phase from being installed.
+ Using the veto tag it is possible to replace beans instead of just installing new ones. </para>
+ </section>
+
+ <section>
+ <title>Initial Field Values</title>
+ <para>Inital field values can be set in two different ways, in addition to the <literal><value></literal> element shown above it can be set as follows:</para>
+ <programlisting>
+ <![CDATA[
+<test:someField>hello world</test:someField>
+ ]]>
+ </programlisting>
+
+ <para>Using this method prevents you from adding any annotations to the field.</para>
+
+ <para>It is possible to set <literal>Map</literal>,<literal>Array</literal> and <literal>Collection</literal> field values. Some examples:</para>
+ <programlisting>
+ <![CDATA[
+<test:ArrayFieldValue>
+ <test:iarray>
+ <value>1</value>
+ <value>2</value>
+ </test:iarray>
+ <test:carray>
+ <value>java.lang.Integer</value>
+ <value>java.lang.Long</value>
+ </test:carray>
+ <test:sarray>
+ <value>hello</value>
+ <value>world</value>
+ </test:sarray>
+</test:ArrayFieldValue>
+
+<test:MapFieldValue>
+ <test:map1>
+ <entry><key>1</key><value>hello</value></entry>
+ <entry><key>2</key><value>world</value></entry>
+ </test:map1>
+ <test:map2>
+ <e><k>1</k><v>java.lang.Integer</v></e>
+ <e><k>2</k><v>java.lang.Long</v></e>
+ </test:map2>
+</test:MapFieldValue>
+ ]]>
+ </programlisting>
+ <para>Type conversion is done automatically for all primitives and primitive wrappers, <literal>Date</literal>,
+ <literal>Calendar</literal>,<literal>Enum</literal> and <literal>Class</literal> fields.
+ In this instance <literal>ArrayFieldValue.carray</literal> is actually an array of classes, not an array of Strings.</para>
+
+ </section>
+ <section>
+ <title>Configuring methods</title>
+
+ <para>It is also possible to configure methods in a similar way to configuring fields:</para>
+ <programlisting>
+ <![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<Beans xmlns="urn:seam:core"
+ xmlns:test="urn:java:org.jboss.seam.xml.test.method">
+ <test:MethodBean>
+ <test:method>
+ <Produces/>
+ </test:method>
+ <test:method>
+ <Produces/>
+ <test:Qualifier1/>
+ <test:MethodValueBean>
+ <test:Qualifier2/>
+ </test:MethodValueBean>
+ </test:method>
+ </test:MethodBean>
+</Beans>
+
+public class MethodBean
+{
+
+ public int method()
+ {
+ return 1;
+ }
+
+ public int method(MethodValueBean bean)
+ {
+ return bean.value + 1;
+ }
+
+}
+
+ ]]>
+ </programlisting>
+
+ <para>In this instance <literal>MethodBean</literal> has two methods, both of them rather imaginatively named <literal>method</literal>.
+ The first <literal><test:method></literal> entry in the XML file configures the method that takes no arguments.
+ The <literal><Produces></literal> element makes it into a producer method. The next entry in the file configures
+ the method that takes a <literal>MethodValueBean</literal> as a parameter.When configuring methods non-annotation classes are
+ considered to represent method paramters. If these parameters have annotation children they are taken to be annotations
+ on the parameter.</para>
+
+ <para>In this instance the corresponding java declaration would be:</para>
+ <programlisting>
+ <![CDATA[
+@Produces
+@Qualifier1
+public int method(@Qualifier2 MethodValueBean param) {//method body}
+ ]]>
+ </programlisting>
+ <para>Array parameters can be represented using the <literal><array></literal> element, with a child element to
+ represent the type of the array. E.g.</para>
+ <programlisting>
+int method(MethodValueBean[] param);
+ </programlisting>
+ <para>could be configured via xml using the following:</para>
+ <programlisting>
+ <![CDATA[
+<test:method>
+ <array>
+ <test:MethodValueBean/>
+ </array>
+</test:method>
+ ]]>
+ </programlisting>
+ </section>
+
+ <section>
+ <title>Annotation Members</title>
+ <para>It is also possible to set the value of annotation members by. For example:</para>
+ <programlisting>
+ <![CDATA[
+public @interface OtherQualifier
+{
+ String value1();
+
+ int value2();
+
+ QualifierEnum value();
+}
+
+
+<test:QualifiedBean1>
+ <test:OtherQualifier value1="AA" value2="1">A</test:OtherQualifier>
+</test:QualifiedBean1>
+
+<test:QualifiedBean2>
+ <test:OtherQualifier value1="BB" value2="2" value="B" />
+</test:QualifiedBean2>
+]]>
+ </programlisting>
+ <para>The value member can be set using the inner text of the node, as seen in the first example.</para>
+ </section>
+
+ <section>
+ <title>More Information</title>
+ <para>For further information look at the units tests in the seam-xml distribution, also the JSR-299
+ public review draft section on XML Configuration was the base for this extension,
+ so it may also be worthwhile reading.</para>
+ </section>
+
+</chapter>
Property changes on: modules/xml/trunk/docs/en-US/xml-general.xml
___________________________________________________________________
Name: svn:executable
+ *
Modified: modules/xml/trunk/docs/pom.xml
===================================================================
--- modules/xml/trunk/docs/pom.xml 2010-02-18 13:45:25 UTC (rev 12061)
+++ modules/xml/trunk/docs/pom.xml 2010-02-19 04:02:28 UTC (rev 12062)
@@ -1,14 +1,19 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.weld</groupId>
+ <artifactId>weld-parent</artifactId>
+ <version>8</version>
+ </parent>
- <groupId>org.jboss.seam</groupId>
- <artifactId>xml-reference-guide</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <groupId>org.jboss.seam.xml</groupId>
+ <artifactId>seam-xml-reference-guide</artifactId>
+ <version>3.0.0-SNAPSHOT</version>
<packaging>jdocbook</packaging>
+ <name>Seam XML Reference Guide</name>
- <name>Seam XML Reference Guide</name>
-
<pluginRepositories>
<pluginRepository>
<id>repository.jboss.org</id>
@@ -24,31 +29,100 @@
</repository>
</repositories>
+ <properties>
+ <pdf.name>xml-reference.pdf</pdf.name>
+ <weld.docbook.version>1.1.1-Beta5</weld.docbook.version>
+ </properties>
+
<build>
+ <defaultGoal>process-classes</defaultGoal>
<plugins>
<plugin>
<groupId>org.jboss.maven.plugins</groupId>
<artifactId>maven-jdocbook-plugin</artifactId>
-
- <configuration>
- <sourceDocumentName>master.xml</sourceDocumentName>
- <masterTranslation>en-US</masterTranslation>
- <formats>
- <format>
- <formatName>pdf</formatName>
- <finalName>remoting-reference.pdf</finalName>
- </format>
- <format>
- <formatName>html</formatName>
- <finalName>index.html</finalName>
- </format>
- </formats>
- <options>
- <xincludeSupported>false</xincludeSupported>
- </options>
- </configuration>
</plugin>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <phase>process-classes</phase>
+ <configuration>
+ <tasks>
+ <copy file="${basedir}/target/docbook/publish/en-US/pdf/${pdf.name}" todir="${basedir}" />
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>attach-zip</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attach-artifact</goal>
+ </goals>
+ <configuration>
+ <artifacts>
+ <artifact>
+ <file>${project.build.outputDirectory}/${project.artifactId}-${project.version}.war</file>
+ <type>war</type>
+ </artifact>
+ </artifacts>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
-
-</project>
\ No newline at end of file
+
+ <profiles>
+
+ <profile>
+ <id>translations</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+
+ <executions>
+ <execution>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>translate</goal>
+ </goals>
+ </execution>
+ </executions>
+
+ <configuration>
+ <translations>
+ <!--translation>it-IT</translation>
+ <translation>zh-CN</translation>
+ <translation>zh-TW</translation>
+ <translation>es-ES</translation>
+ <translation>ko-KR</translation>
+
+ <translation>de-DE</translation>
+ <translation>pt-BR</translation-->
+ </translations>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
+ </profiles>
+
+
+ <scm>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/seam/modules/xml/trunk/docs</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/seam/modules/xml/trunk/docs</developerConnection>
+ <url>http://fisheye.jboss.org/browse/seam/modules/xml/docs</url>
+ </scm>
+</project>
14 years, 11 months