Seam SVN: r13427 - in modules/persistence/trunk/src/main/java/org/jboss/seam: transaction and 1 other directory.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-07-18 03:59:16 -0400 (Sun, 18 Jul 2010)
New Revision: 13427
Modified:
modules/persistence/trunk/src/main/java/org/jboss/seam/persistence/PersistenceContextExtension.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AbstractUserTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AfterTransactionCompletion.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/BeforeTransactionCompletion.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/CMTTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EJB.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EjbSynchronizations.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EntityTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/JtaTxInterceptor.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/LocalEjbSynchronizations.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Naming.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/NoTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SeSynchronizations.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SynchronizationRegistry.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Synchronizations.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionExtension.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionPropagation.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionQualifier.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transactional.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UTTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UserTransaction.java
modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Work.java
Log:
fix headers
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/persistence/PersistenceContextExtension.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/persistence/PersistenceContextExtension.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/persistence/PersistenceContextExtension.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.persistence;
import java.lang.annotation.Annotation;
@@ -28,6 +49,7 @@
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.PersistenceContext;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AbstractUserTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AbstractUserTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AbstractUserTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import static javax.transaction.Status.STATUS_ACTIVE;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AfterTransactionCompletion.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AfterTransactionCompletion.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/AfterTransactionCompletion.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
public class AfterTransactionCompletion
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/BeforeTransactionCompletion.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/BeforeTransactionCompletion.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/BeforeTransactionCompletion.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
public class BeforeTransactionCompletion
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/CMTTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/CMTTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/CMTTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.ejb.EJBContext;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EJB.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EJB.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EJB.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.ejb.EJBContext;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EjbSynchronizations.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EjbSynchronizations.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EjbSynchronizations.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.rmi.RemoteException;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EntityTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EntityTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/EntityTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.enterprise.context.RequestScoped;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/JtaTxInterceptor.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/JtaTxInterceptor.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/JtaTxInterceptor.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.lang.annotation.Annotation;
@@ -2,2 +23,3 @@
import java.lang.reflect.Method;
+
import javax.inject.Inject;
@@ -8,6 +30,7 @@
import javax.interceptor.InvocationContext;
import javax.transaction.Status;
import javax.transaction.UserTransaction;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/LocalEjbSynchronizations.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/LocalEjbSynchronizations.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/LocalEjbSynchronizations.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.ejb.Local;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Naming.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Naming.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Naming.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,8 +1,23 @@
/*
* JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
*
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jboss.seam.transaction;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/NoTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/NoTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/NoTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.persistence.EntityManager;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SeSynchronizations.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SeSynchronizations.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SeSynchronizations.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.util.Stack;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SynchronizationRegistry.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SynchronizationRegistry.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/SynchronizationRegistry.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.util.ArrayList;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Synchronizations.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Synchronizations.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Synchronizations.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.transaction.Synchronization;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.enterprise.context.ApplicationScoped;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionExtension.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionExtension.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionExtension.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,24 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
-import java.lang.annotation.Annotation;
import java.util.Collections;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Default;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.BeforeBeanDiscovery;
import javax.enterprise.inject.spi.Extension;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.InjectionTarget;
-import javax.enterprise.inject.spi.ProcessBean;
import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
import org.jboss.weld.extensions.bean.BeanBuilder;
import org.jboss.weld.extensions.bean.BeanImpl;
import org.jboss.weld.extensions.bean.BeanLifecycle;
+import org.jboss.weld.extensions.defaultbean.DefaultBeanExtension;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -43,41 +62,15 @@
private static final Logger log = LoggerFactory.getLogger(TransactionExtension.class);
- public void processBean(@Observes ProcessBean<?> event)
+ public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event,BeanManager manager)
{
- Bean<?> bean = event.getBean();
- if (bean.getTypes().contains(UserTransaction.class))
- {
- if (bean.getQualifiers().isEmpty()) // not sure about this
- {
- transactionRegistered = true;
- }
- else
- {
- for (Annotation a : event.getBean().getQualifiers())
- {
- if (a.annotationType() == Default.class)
- {
- transactionRegistered = true;
- break;
- }
- }
- }
- }
- }
+ AnnotatedTypeBuilder<UserTransaction> utbuilder = AnnotatedTypeBuilder.newInstance(UserTransaction.class);
+ BeanBuilder<UserTransaction> builder = new BeanBuilder<UserTransaction>(utbuilder.create(), manager);
+ builder.defineBeanFromAnnotatedType();
- public void afterBeanDiscovery(@Observes AfterBeanDiscovery event, BeanManager manager)
- {
- if (!transactionRegistered)
- {
- AnnotatedTypeBuilder<UserTransaction> utbuilder = AnnotatedTypeBuilder.newInstance(UserTransaction.class);
- BeanBuilder<UserTransaction> builder = new BeanBuilder<UserTransaction>(utbuilder.create(), manager);
- builder.defineBeanFromAnnotatedType();
-
- builder.setBeanLifecycle(new TransactionLifecycle(manager));
- builder.setInjectionTarget(new NoOpInjectionTarget());
- event.addBean(builder.create());
- }
+ builder.setBeanLifecycle(new TransactionLifecycle(manager));
+ builder.setInjectionTarget(new NoOpInjectionTarget());
+ DefaultBeanExtension.addDefaultBean(UserTransaction.class, builder.create());
}
private static class TransactionLifecycle implements BeanLifecycle<UserTransaction>
@@ -109,7 +102,7 @@
}
/**
- * we need to init the bean definition lazily, as there
+ * we need to init the bean definition lazily
*/
private void setupBeanDefinition()
{
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.lang.reflect.AnnotatedElement;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionPropagation.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionPropagation.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionPropagation.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
/**
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionQualifier.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionQualifier.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/TransactionQualifier.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.lang.annotation.Retention;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transactional.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transactional.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Transactional.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import java.lang.annotation.ElementType;
@@ -5,6 +26,7 @@
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
+
import javax.enterprise.util.Nonbinding;
import javax.interceptor.InterceptorBinding;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UTTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UTTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UTTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.transaction.HeuristicMixedException;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UserTransaction.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UserTransaction.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/UserTransaction.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.persistence.EntityManager;
Modified: modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Work.java
===================================================================
--- modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Work.java 2010-07-18 05:06:33 UTC (rev 13426)
+++ modules/persistence/trunk/src/main/java/org/jboss/seam/transaction/Work.java 2010-07-18 07:59:16 UTC (rev 13427)
@@ -1,3 +1,24 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
package org.jboss.seam.transaction;
import javax.ejb.ApplicationException;
14 years, 5 months
Seam SVN: r13426 - in modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml: parser/namespace and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-07-18 01:06:33 -0400 (Sun, 18 Jul 2010)
New Revision: 13426
Added:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/TypeOccuranceInformation.java
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/EntryXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModifiesXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParameterXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParametersXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
Log:
add stricter validation to the xml
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -25,9 +25,11 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class AnnotationXmlItem extends AbstractXmlItem
{
- private final HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ private final HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public AnnotationXmlItem(XmlItem parent, Class<?> c, String innerText, Map<String, String> attributes, String document, int lineno)
{
@@ -39,10 +41,10 @@
attributes.put("value", innerText);
}
}
- allowed.add(XmlItemType.ANNOTATION);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ANNOTATION, null, null));
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -37,6 +37,7 @@
import org.jboss.seam.xml.core.BeanResult;
import org.jboss.seam.xml.core.BeanResultType;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
import org.jboss.weld.extensions.util.Reflections;
@@ -44,18 +45,20 @@
public class ClassXmlItem extends AbstractXmlItem
{
- HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public ClassXmlItem(XmlItem parent, Class<?> c, Map<String, String> attributes, String document, int lineno)
{
super(XmlItemType.CLASS, parent, c, null, attributes, document, lineno);
- allowed.add(XmlItemType.ANNOTATION);
- allowed.add(XmlItemType.FIELD);
- allowed.add(XmlItemType.METHOD);
- allowed.add(XmlItemType.PARAMETERS);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ANNOTATION, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.FIELD, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.METHOD, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.PARAMETERS, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.REPLACE, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.MODIFIES, null, null));
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/EntryXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/EntryXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/EntryXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,12 +24,13 @@
import java.util.HashSet;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
public class EntryXmlItem extends AbstractXmlItem
{
- final Set<XmlItemType> allowed = new HashSet<XmlItemType>();
+ final Set<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
XmlItem key;
XmlItem value;
@@ -37,11 +38,11 @@
public EntryXmlItem(XmlItem parent, String document, int lineno)
{
super(XmlItemType.ENTRY, parent, null, null, null, document, lineno);
- allowed.add(XmlItemType.VALUE);
- allowed.add(XmlItemType.KEY);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.VALUE, 1, 1));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.KEY, 1, 1));
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/FieldXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -38,6 +38,7 @@
import org.jboss.seam.xml.fieldset.MapFieldSet;
import org.jboss.seam.xml.fieldset.MethodFieldSetter;
import org.jboss.seam.xml.fieldset.SimpleFieldValue;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
public class FieldXmlItem extends AbstractXmlItem implements FieldValueXmlItem
@@ -46,7 +47,7 @@
FieldValueSetter fieldSetter;
FieldValueObject fieldValue;
Field field;
- HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public FieldXmlItem(XmlItem parent, Field c, String innerText, String document, int lineno)
{
@@ -57,8 +58,9 @@
{
fieldValue = new SimpleFieldValue(parent.getJavaClass(), fieldSetter, innerText);
}
- allowed.add(XmlItemType.ANNOTATION);
- allowed.add(XmlItemType.VALUE);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ANNOTATION, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.VALUE, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ENTRY, null, null));
}
public Field getField()
@@ -138,7 +140,7 @@
return true;
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/GenericBeanXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -25,6 +25,7 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
public class GenericBeanXmlItem extends AbstractXmlItem
@@ -45,9 +46,9 @@
}
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
- return Collections.singleton(XmlItemType.CLASS);
+ return Collections.singleton(TypeOccuranceInformation.of(XmlItemType.CLASS, 1, null));
}
public Class<?> getClass(String className, String document, int lineno)
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/KeyXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class KeyXmlItem extends AbstractXmlItem
{
@@ -32,7 +34,7 @@
super(XmlItemType.KEY, parent, null, innerText, null, document, lineno);
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return Collections.emptySet();
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/MethodXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -27,6 +27,7 @@
import java.util.List;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
public class MethodXmlItem extends AbstractXmlItem
@@ -35,14 +36,14 @@
private String methodName;
Method method;
- HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public MethodXmlItem(XmlItem parent, String methodName, String document, int lineno)
{
super(XmlItemType.METHOD, parent, parent.getJavaClass(), null, null, document, lineno);
- allowed.add(XmlItemType.ANNOTATION);
- allowed.add(XmlItemType.PARAMETERS);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ANNOTATION, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.PARAMETERS, null, 1));
// methods are lazily resolved once we know the parameter types
this.methodName = methodName;
@@ -122,7 +123,7 @@
return method;
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -42,6 +42,7 @@
import org.jboss.seam.xml.parser.namespace.CompositeNamespaceElementResolver;
import org.jboss.seam.xml.parser.namespace.NamespaceElementResolver;
import org.jboss.seam.xml.parser.namespace.RootNamespaceElementResolver;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
/**
@@ -109,7 +110,7 @@
@SuppressWarnings("unchecked")
private void addNodeToResult(XmlResult ret, XmlItem xmlItem)
{
-
+ validateXmlItem(xmlItem);
if (xmlItem.getType() == XmlItemType.CLASS || xmlItem.getType() == XmlItemType.ANNOTATION)
{
ResultType resultType = getItemType(xmlItem);
@@ -305,15 +306,53 @@
public void validateXmlItem(XmlItem item)
{
- Set<XmlItemType> allowed = item.getAllowedItem();
+ Set<TypeOccuranceInformation> allowed = item.getAllowedItem();
+ Map<XmlItemType, Integer> counts = new HashMap<XmlItemType, Integer>();
for (XmlItem i : item.getChildren())
{
- if (!allowed.contains(item.getType()))
+ boolean found = false;
+ for (TypeOccuranceInformation type : allowed)
{
+ if (type.getType() == i.getType())
+ {
+ found = true;
+ if (counts.containsKey(i.getType()))
+ {
+ counts.put(i.getType(), counts.get(i.getType()) + 1);
+ }
+ else
+ {
+ counts.put(i.getType(), 1);
+ }
+ }
+ }
+ if (!found)
+ {
throw new XmlConfigurationException("Item " + item.getType() + " is not allowed to contain " + i.getType(), item.getDocument(), item.getLineno());
}
validateXmlItem(i);
}
+ for (TypeOccuranceInformation type : allowed)
+ {
+ Integer count = counts.get(type.getType());
+ if (type.getMaxOccurances() != null)
+ {
+ if (count != null)
+ {
+ if (count > type.getMaxOccurances())
+ {
+ throw new XmlConfigurationException("Item " + item.getType() + " has " + count + "children of type " + type.getType() + " when it should have at most " + type.getMaxOccurances(), item.getDocument(), item.getLineno());
+ }
+ }
+ }
+ if (type.getMinOccurances() != null)
+ {
+ if (count == null || count < type.getMinOccurances())
+ {
+ throw new XmlConfigurationException("Item " + item.getType() + " has " + count + "children of type " + type.getType() + " when it should have at least " + type.getMaxOccurances(), item.getDocument(), item.getLineno());
+
+ }
+ }
+ }
}
-
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModifiesXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModifiesXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModifiesXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class ModifiesXmlItem extends AbstractXmlItem
{
@@ -33,7 +35,7 @@
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return Collections.emptySet();
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParameterXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParameterXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParameterXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
/**
* represents a parameter of a constructor or method
*
@@ -32,15 +34,17 @@
*/
public class ParameterXmlItem extends AbstractXmlItem
{
- HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public ParameterXmlItem(XmlItem parent, Class<?> c, String document, int lineno)
{
super(XmlItemType.PARAMETER, parent, c, null, null, document, lineno);
- allowed.add(XmlItemType.ANNOTATION);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ANNOTATION, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.CLASS, null, 1));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ARRAY, null, 1));
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParametersXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParametersXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ParametersXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class ParametersXmlItem extends AbstractXmlItem
{
@@ -33,9 +35,9 @@
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
- return Collections.singleton(XmlItemType.PARAMETER);
+ return Collections.singleton(TypeOccuranceInformation.of(XmlItemType.PARAMETER, 1, null));
}
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/PropertyXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -36,6 +36,7 @@
import org.jboss.seam.xml.fieldset.MapFieldSet;
import org.jboss.seam.xml.fieldset.MethodFieldSetter;
import org.jboss.seam.xml.fieldset.SimpleFieldValue;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
public class PropertyXmlItem extends AbstractXmlItem implements FieldValueXmlItem
@@ -45,7 +46,7 @@
FieldValueObject fieldValue;
String name;
Class<?> type;
- HashSet<XmlItemType> allowed = new HashSet<XmlItemType>();
+ HashSet<TypeOccuranceInformation> allowed = new HashSet<TypeOccuranceInformation>();
public PropertyXmlItem(XmlItem parent, String name, Method setter, String innerText, String document, int lineno)
{
@@ -57,7 +58,8 @@
{
fieldValue = new SimpleFieldValue(parent.getJavaClass(), fieldSetter, innerText);
}
- allowed.add(XmlItemType.VALUE);
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.VALUE, null, null));
+ allowed.add(TypeOccuranceInformation.of(XmlItemType.ENTRY, null, null));
}
public FieldValueObject getFieldValue()
@@ -132,7 +134,7 @@
return true;
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return allowed;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class ReplacesXmlItem extends AbstractXmlItem
{
@@ -33,7 +35,7 @@
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
return Collections.emptySet();
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ValueXmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.Collections;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public class ValueXmlItem extends AbstractXmlItem
{
@@ -32,8 +34,9 @@
super(XmlItemType.VALUE, parent, null, innerText, null, document, lineno);
}
- public Set<XmlItemType> getAllowedItem()
+ public Set<TypeOccuranceInformation> getAllowedItem()
{
- return Collections.emptySet();
+ return Collections.singleton(TypeOccuranceInformation.of(XmlItemType.CLASS, null, 1));
}
+
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItem.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItem.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -24,6 +24,8 @@
import java.util.List;
import java.util.Set;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
+
public interface XmlItem
{
@@ -47,7 +49,7 @@
*/
public boolean resolveChildren();
- public Set<XmlItemType> getAllowedItem();
+ public Set<TypeOccuranceInformation> getAllowedItem();
int getLineno();
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-07-18 04:28:50 UTC (rev 13425)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/PackageNamespaceElementResolver.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -37,6 +37,7 @@
import org.jboss.seam.xml.model.XmlItem;
import org.jboss.seam.xml.model.XmlItemType;
import org.jboss.seam.xml.parser.SaxNode;
+import org.jboss.seam.xml.util.TypeOccuranceInformation;
import org.jboss.seam.xml.util.XmlConfigurationException;
import org.jboss.weld.extensions.util.Reflections;
@@ -101,7 +102,7 @@
if (parent != null)
{
// if the item can be a method of a FIELD
- if (parent.getAllowedItem().contains(XmlItemType.METHOD) || parent.getAllowedItem().contains(XmlItemType.FIELD))
+ if (TypeOccuranceInformation.isTypeInSet(parent.getAllowedItem(), XmlItemType.METHOD) || TypeOccuranceInformation.isTypeInSet(parent.getAllowedItem(), XmlItemType.FIELD))
{
return resolveMethodOrField(name, parent, node.getInnerText(), node.getDocument(), node.getLineNo());
}
Added: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/TypeOccuranceInformation.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/TypeOccuranceInformation.java (rev 0)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/util/TypeOccuranceInformation.java 2010-07-18 05:06:33 UTC (rev 13426)
@@ -0,0 +1,51 @@
+package org.jboss.seam.xml.util;
+
+import java.util.Set;
+
+import org.jboss.seam.xml.model.XmlItemType;
+
+public class TypeOccuranceInformation
+{
+ private final XmlItemType type;
+ private final Integer minOccurances;
+ private final Integer maxOccurances;
+
+ public TypeOccuranceInformation(XmlItemType type, Integer minOccurances, Integer maxOccurances)
+ {
+ this.type = type;
+ this.minOccurances = minOccurances;
+ this.maxOccurances = maxOccurances;
+ }
+
+ public XmlItemType getType()
+ {
+ return type;
+ }
+
+ public Integer getMinOccurances()
+ {
+ return minOccurances;
+ }
+
+ public Integer getMaxOccurances()
+ {
+ return maxOccurances;
+ }
+
+ public static TypeOccuranceInformation of(XmlItemType type, Integer min, Integer max)
+ {
+ return new TypeOccuranceInformation(type, min, min);
+ }
+
+ public static boolean isTypeInSet(Set<TypeOccuranceInformation> set, XmlItemType type)
+ {
+ for (TypeOccuranceInformation i : set)
+ {
+ if (i.getType() == type)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+}
14 years, 5 months
Seam SVN: r13425 - modules/xml/trunk/docs/src/main/docbook/en-US.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-07-18 00:28:50 -0400 (Sun, 18 Jul 2010)
New Revision: 13425
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
Log:
missed some references to <override> in the docs
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-07-18 04:26:36 UTC (rev 13424)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-07-18 04:28:50 UTC (rev 13425)
@@ -142,7 +142,7 @@
<itemizedlist>
<listitem><para><literal>Beans</literal></para></listitem>
<listitem><para><literal>modifies</literal></para></listitem>
- <listitem><para><literal>overrides</literal></para></listitem>
+ <listitem><para><literal>replaces</literal></para></listitem>
<listitem><para><literal>parameters</literal></para></listitem>
<listitem><para><literal>value</literal></para></listitem>
<listitem><para><literal>key</literal></para></listitem>
@@ -193,9 +193,9 @@
<title>Overriding and extending beans</title>
<para>By configuring a bean via XML creates a new bean, however there
may be cases where you want to modify an existing bean rather than
- adding a new one. The <literal><s:overrides></literal> and
+ adding a new one. The <literal><s:replaces></literal> and
<literal><s:modifies></literal> tags allow you to do this.</para>
- <para>The <literal><s:overrides></literal> tag prevents the existing bean from being
+ <para>The <literal><s:replaces></literal> tag prevents the existing bean from being
installed, and registers a new one with the given configuration. The
<literal><s:modifies></literal> tag does the same, except that it merges
the annotations on the bean with the annotations defined in XML. This has the
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-07-18 04:26:36 UTC (rev 13424)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-07-18 04:28:50 UTC (rev 13425)
@@ -76,7 +76,7 @@
<area id="filename" coords="11"/>
<area id="datasource-qualifier" coords="13"/>
<area id="filename-short" coords="17"/>
- <area id="overrides" coords="18"/>
+ <area id="replaces" coords="18"/>
<area id="inject" coords="20"/>
<area id="datasource-type" coords="21"/>
</areaspec>
@@ -131,12 +131,12 @@
<callout arearefs="filename-short">
<para>This is the shorthand syntax for setting a field value.</para>
</callout>
- <callout arearefs="overrides">
- <para>Beans installed using <literal><s:overrides></literal> do not read annotations from the existing class. In addition if a bean is installed with
- <literal><s:overrides></literal> it prevents the original class being installed as a bean.</para>
+ <callout arearefs="replaces">
+ <para>Beans installed using <literal><s:replaces></literal> do not read annotations from the existing class. In addition if a bean is installed with
+ <literal><s:replaces></literal> it prevents the original class being installed as a bean.</para>
</callout>
<callout arearefs="inject">
- <para>The <literal><s:Inject></literal> element is needed this bean was installed with <literal><s:overrides></literal>, so annotations are not read
+ <para>The <literal><s:Inject></literal> element is needed this bean was installed with <literal><s:replaces></literal>, so annotations are not read
from the class definition.</para>
</callout>
<callout arearefs="datasource-type">
14 years, 5 months
Seam SVN: r13424 - in modules/xml/trunk: impl/src/main/java/org/jboss/seam/xml/model and 10 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-07-18 00:26:36 -0400 (Sun, 18 Jul 2010)
New Revision: 13424
Added:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java
Removed:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/OverrideXmlItem.java
Modified:
modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
modules/xml/trunk/impl/src/test/resources/META-INF/beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
Log:
SEAMXML-13 Change <override> to <replaces>
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-general.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -208,7 +208,7 @@
</test:Report>
<test:ReportDatasource>
- <s:overrides>
+ <s:replaces>
<test:NewQualifier/>
</test:ReportDatasource>]]>
</programlisting>
Modified: modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml
===================================================================
--- modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/docs/src/main/docbook/en-US/xml-introduction.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -97,7 +97,7 @@
</r:Report>
<r:Report filename="billing.jrxml">
- <s:overrides/>
+ <s:replaces/>
<r:datasource>
<s:Inject/>
<s:Exact>org.example.reports.BillingDatasource</s:Exact>
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -98,7 +98,7 @@
public BeanResult<?> createBeanResult()
{
- boolean override = !getChildrenOfType(OverrideXmlItem.class).isEmpty();
+ boolean override = !getChildrenOfType(ReplacesXmlItem.class).isEmpty();
boolean extend = !getChildrenOfType(ModifiesXmlItem.class).isEmpty();
BeanResultType beanType = BeanResultType.ADD;
if (override && extend)
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -107,23 +107,23 @@
}
@SuppressWarnings("unchecked")
- private void addNodeToResult(XmlResult ret, XmlItem rb)
+ private void addNodeToResult(XmlResult ret, XmlItem xmlItem)
{
- if (rb.getType() == XmlItemType.CLASS || rb.getType() == XmlItemType.ANNOTATION)
+ if (xmlItem.getType() == XmlItemType.CLASS || xmlItem.getType() == XmlItemType.ANNOTATION)
{
- ResultType type = getItemType(rb);
+ ResultType resultType = getItemType(xmlItem);
// if we are configuring a bean
- if (type == ResultType.BEAN)
+ if (resultType == ResultType.BEAN)
{
- ClassXmlItem cxml = (ClassXmlItem) rb;
+ ClassXmlItem cxml = (ClassXmlItem) xmlItem;
// get the AnnotatedType information
- BeanResult<?> tp = cxml.createBeanResult();
- ret.addBean(tp);
+ BeanResult<?> beanResult = cxml.createBeanResult();
+ ret.addBean(beanResult);
// <override> or <speciailizes> need to veto the bean
- if (tp.getBeanType() != BeanResultType.ADD)
+ if (beanResult.getBeanType() != BeanResultType.ADD)
{
- ret.addVeto(tp.getType());
+ ret.addVeto(beanResult.getType());
}
// get all the field values from the bean
Set<String> configuredFields = new HashSet<String>();
@@ -149,35 +149,35 @@
if (!fields.isEmpty())
{
- if (rb.getJavaClass().isInterface())
+ if (xmlItem.getJavaClass().isInterface())
{
- ret.addInterfaceFieldValues(tp.getType(), fields);
+ ret.addInterfaceFieldValues(beanResult.getType(), fields);
}
else
{
- ret.addFieldValue(tp, fields);
+ ret.addFieldValue(beanResult, fields);
}
}
}
- else if (type == ResultType.QUALIFIER)
+ else if (resultType == ResultType.QUALIFIER)
{
- ret.addQualifier((Class) rb.getJavaClass());
+ ret.addQualifier((Class) xmlItem.getJavaClass());
}
- else if (type == ResultType.INTERCEPTOR_BINDING)
+ else if (resultType == ResultType.INTERCEPTOR_BINDING)
{
- ret.addInterceptorBinding((Class) rb.getJavaClass());
+ ret.addInterceptorBinding((Class) xmlItem.getJavaClass());
}
- else if (type == ResultType.STEREOTYPE)
+ else if (resultType == ResultType.STEREOTYPE)
{
- addStereotypeToResult(ret, rb);
+ addStereotypeToResult(ret, xmlItem);
}
}
- else if (rb.getType() == XmlItemType.GENERIC_BEAN)
+ else if (xmlItem.getType() == XmlItemType.GENERIC_BEAN)
{
- GenericBeanXmlItem item = (GenericBeanXmlItem) rb;
+ GenericBeanXmlItem item = (GenericBeanXmlItem) xmlItem;
Set<BeanResult<?>> classes = new HashSet<BeanResult<?>>();
- for (ClassXmlItem c : rb.getChildrenOfType(ClassXmlItem.class))
+ for (ClassXmlItem c : xmlItem.getChildrenOfType(ClassXmlItem.class))
{
BeanResult<?> br = c.createBeanResult();
if (br.getBeanType() != BeanResultType.ADD)
Deleted: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/OverrideXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/OverrideXmlItem.java 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/OverrideXmlItem.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -1,41 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.seam.xml.model;
-
-import java.util.Collections;
-import java.util.Set;
-
-public class OverrideXmlItem extends AbstractXmlItem
-{
-
- public OverrideXmlItem(XmlItem parent, String document, int lineno)
- {
- super(XmlItemType.OVERRIDE, parent, null, null, null, document, lineno);
-
- }
-
- public Set<XmlItemType> getAllowedItem()
- {
- return Collections.emptySet();
- }
-
-}
Copied: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java (from rev 13387, modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/OverrideXmlItem.java)
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java (rev 0)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ReplacesXmlItem.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -0,0 +1,41 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2010, Red Hat, Inc., and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.seam.xml.model;
+
+import java.util.Collections;
+import java.util.Set;
+
+public class ReplacesXmlItem extends AbstractXmlItem
+{
+
+ public ReplacesXmlItem(XmlItem parent, String document, int lineno)
+ {
+ super(XmlItemType.REPLACE, parent, null, null, null, document, lineno);
+
+ }
+
+ public Set<XmlItemType> getAllowedItem()
+ {
+ return Collections.emptySet();
+ }
+
+}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/XmlItemType.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -23,5 +23,5 @@
public enum XmlItemType
{
- CLASS, METHOD, FIELD, ANNOTATION, VALUE, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, OVERRIDE, MODIFIES, GENERIC_BEAN;
+ CLASS, METHOD, FIELD, ANNOTATION, VALUE, ENTRY, KEY, DEPENDENCY, PARAMETERS, PARAMETER, ARRAY, REPLACE, MODIFIES, GENERIC_BEAN;
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/parser/namespace/RootNamespaceElementResolver.java 2010-07-18 04:26:36 UTC (rev 13424)
@@ -27,7 +27,7 @@
import org.jboss.seam.xml.model.GenericBeanXmlItem;
import org.jboss.seam.xml.model.KeyXmlItem;
import org.jboss.seam.xml.model.ModifiesXmlItem;
-import org.jboss.seam.xml.model.OverrideXmlItem;
+import org.jboss.seam.xml.model.ReplacesXmlItem;
import org.jboss.seam.xml.model.ParameterXmlItem;
import org.jboss.seam.xml.model.ParametersXmlItem;
import org.jboss.seam.xml.model.ValueXmlItem;
@@ -74,9 +74,9 @@
{
return new ArrayXmlItem(parent, node.getAttributes(), node.getDocument(), node.getLineNo());
}
- else if (item.equals("overrides"))
+ else if (item.equals("replaces"))
{
- return new OverrideXmlItem(parent, node.getDocument(), node.getLineNo());
+ return new ReplacesXmlItem(parent, node.getDocument(), node.getLineNo());
}
else if (item.equals("modifies"))
{
Modified: modules/xml/trunk/impl/src/test/resources/META-INF/beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/META-INF/beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/META-INF/beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -13,7 +13,7 @@
</test:InterceptorBinding>
<test:InterceptorBean>
- <s:overrides/>
+ <s:replaces/>
<s:Interceptor/>
<test:InterceptorBinding/>
<test:myMethod>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/constructor/constructor-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -10,7 +10,7 @@
</test:ValueProvider>
<test:ConstructedBean>
- <overrides/>
+ <replaces/>
<parameters><int/></parameters>
</test:ConstructedBean>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/array-set-field-value-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -2,7 +2,7 @@
<beans xmlns="urn:java:ee"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:ArrayFieldValue>
- <overrides/>
+ <replaces/>
<test:iarray>
<value>1</value>
<value>2</value>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/colection-set-field-value-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -3,7 +3,7 @@
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:CollectionFieldValue>
- <overrides/>
+ <replaces/>
<test:iset>
<value>1</value>
<value>2</value>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/map-set-field-value-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -2,7 +2,7 @@
<beans xmlns="urn:java:ee"
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:MapFieldValue>
- <overrides/>
+ <replaces/>
<test:map1>
<entry><key>1</key><value>hello</value></entry>
<entry><key>2</key><value>world</value></entry>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/fieldset/set-field-value-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -3,7 +3,7 @@
xmlns:test="urn:java:org.jboss.seam.xml.test.fieldset">
<test:FieldValueBean>
- <overrides/>
+ <replaces/>
<test:init>
<Inject/>
</test:init>
@@ -20,7 +20,7 @@
</test:FieldValueBean>
<test:FieldValueBean ivalue="10" stringValue="hello world" enumValue="A" fvalue="0" dvalue="0" bvalue="true" lvalue="23" svalue="4" bigDecimalValue="10" noField="7" >
- <overrides/>
+ <replaces/>
<test:init>
<Inject/>
</test:init>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/producer-field-value-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -8,7 +8,7 @@
</test:ProducerQualifier>
<test:ProducerBean>
- <overrides/>
+ <replaces/>
<test:value>
<Produces/>
<test:ProducerQualifier/>
@@ -17,7 +17,7 @@
</test:ProducerBean>
<test:RecieverBean>
- <overrides/>
+ <replaces/>
<test:value>
<test:ProducerQualifier/>
<Inject/>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/injection/qualifier-attributes-test-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -15,7 +15,7 @@
</test:QualifiedBean2>
<test:QualifierTestBean>
- <overrides/>
+ <replaces/>
<test:bean1>
<test:OtherQualifier value1="AA" value2="1" value="A" />
<Inject/>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/interceptor/interceptor-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -3,7 +3,7 @@
xmlns:test="urn:java:org.jboss.seam.xml.test.interceptor">
<test:InterceptedBean>
- <overrides/>
+ <replaces/>
<test:method>
<test:InterceptorBinding/>
</test:method>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/method/method-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -49,7 +49,7 @@
</test:MethodBean>
<test:MethodTarget>
- <overrides/>
+ <replaces/>
<test:value1>
<Inject />
</test:value1>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/producer/multiple-producers.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -4,7 +4,7 @@
<test:Producer>
- <overrides/>
+ <replaces/>
<test:value>
<Produces/>
<test:ProducerQualifier value="1" />
@@ -30,7 +30,7 @@
<test:Reciever>
- <overrides/>
+ <replaces/>
<test:val1>
<Inject/>
<test:ProducerQualifier value="1" />
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/simple/simple-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -4,7 +4,7 @@
<test:Bean1>
- <overrides/>
+ <replaces/>
<test:bean2>
<Inject/>
</test:bean2>
@@ -17,14 +17,14 @@
</test:Bean1>
<test:Bean2>
- <overrides/>
+ <replaces/>
<test:produceBean3>
<Produces/>
</test:produceBean3>
</test:Bean2>
<test:OverriddenBean>
- <overrides/>
+ <replaces/>
<Named>someBean</Named>
</test:OverriddenBean>
Modified: modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml
===================================================================
--- modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml 2010-07-18 03:40:48 UTC (rev 13423)
+++ modules/xml/trunk/impl/src/test/resources/org/jboss/seam/xml/test/types/types-test-beans.xml 2010-07-18 04:26:36 UTC (rev 13424)
@@ -4,7 +4,7 @@
<test:TypeInjectedClass>
- <overrides/>
+ <replaces/>
<test:value>
<Inject/>
<Exact>org.jboss.seam.xml.test.types.AllowedType</Exact>
14 years, 5 months
Seam SVN: r13423 - in modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml: core and 1 other directories.
by seam-commits@lists.jboss.org
Author: swd847
Date: 2010-07-17 23:40:48 -0400 (Sat, 17 Jul 2010)
New Revision: 13423
Added:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationUtils.java
Modified:
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlDocument.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
Log:
refactoring
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlDocument.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlDocument.java 2010-07-17 18:46:05 UTC (rev 13422)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlDocument.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -27,5 +27,13 @@
{
public InputSource getInputSource();
+ /**
+ * This serves two purposes, one it is used to display to the user the
+ * location of the file that contains an error, and the reversed file URL is
+ * also used to sort the bean results so the beans are always installed in
+ * the same order.
+ *
+ */
public String getFileUrl();
+
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-07-17 18:46:05 UTC (rev 13422)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/bootstrap/XmlExtension.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -25,6 +25,7 @@
import java.lang.reflect.Constructor;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
@@ -113,7 +114,7 @@
ParserMain parser = new ParserMain();
ModelBuilder builder = new ModelBuilder();
SaxNode parentNode = parser.parse(d.getInputSource(), d.getFileUrl(), errors);
- results.add(builder.build(parentNode));
+ results.add(builder.build(parentNode, d.getFileUrl()));
}
}
catch (Exception e)
@@ -121,6 +122,8 @@
errors.add(e);
}
}
+ // we sort the results so the beans are always installed in the same order
+ Collections.sort(results);
// build the generic bean data
for (XmlResult r : results)
{
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-07-17 18:46:05 UTC (rev 13422)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/core/XmlResult.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -35,7 +35,7 @@
* @author Stuart Douglas <stuart(a)baileyroberts.com.au>
*
*/
-public class XmlResult
+public class XmlResult implements Comparable<XmlResult>
{
private final Map<Class<? extends Annotation>, Annotation[]> stereotypes = new HashMap<Class<? extends Annotation>, Annotation[]>();
@@ -56,6 +56,18 @@
private final Map<Class<?>, List<FieldValueObject>> interfaceFieldValues = new HashMap<Class<?>, List<FieldValueObject>>();
+ private final String sortKey;
+
+ public XmlResult(String fileUrl)
+ {
+ StringBuilder keyBuilder = new StringBuilder(fileUrl.length());
+ for (int i = fileUrl.length() - 1; i >= 0; --i)
+ {
+ keyBuilder.append(fileUrl.charAt(i));
+ }
+ sortKey = keyBuilder.toString();
+ }
+
public void addStereotype(Class<? extends Annotation> an, Annotation[] values)
{
stereotypes.put(an, values);
@@ -146,4 +158,9 @@
return genericBeans;
}
+ public int compareTo(XmlResult o)
+ {
+ return sortKey.compareTo(o.sortKey);
+ }
+
}
Added: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationUtils.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationUtils.java (rev 0)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/AnnotationUtils.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -0,0 +1,40 @@
+package org.jboss.seam.xml.model;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.seam.xml.util.XmlConfigurationException;
+import org.jboss.seam.xml.util.XmlObjectConverter;
+import org.jboss.weld.extensions.util.AnnotationInstanceProvider;
+
+class AnnotationUtils
+{
+ final private static AnnotationInstanceProvider annotationInstanceProvider = new AnnotationInstanceProvider();
+
+ @SuppressWarnings("unchecked")
+ static Annotation createAnnotation(AnnotationXmlItem item)
+ {
+ Map<String, Object> typedVars = new HashMap<String, Object>();
+ Class<?> anClass = item.getJavaClass();
+ for (Entry<String, String> e : item.getAttributes().entrySet())
+ {
+ String mname = e.getKey();
+ Method m;
+ try
+ {
+ m = anClass.getDeclaredMethod(mname);
+ }
+ catch (Exception e1)
+ {
+ throw new XmlConfigurationException("Annotation " + item.getJavaClass().getName() + " does not have a member named " + mname + " ,error in XML", item.getDocument(), item.getLineno());
+ }
+ Class<?> returnType = m.getReturnType();
+ typedVars.put(mname, XmlObjectConverter.convert(returnType, e.getValue()));
+ }
+
+ return annotationInstanceProvider.get((Class) item.getJavaClass(), typedVars);
+ }
+}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-17 18:46:05 UTC (rev 13422)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ClassXmlItem.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -21,14 +21,24 @@
*/
package org.jboss.seam.xml.model;
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
+import javax.enterprise.util.AnnotationLiteral;
+import javax.inject.Inject;
+
+import org.jboss.seam.xml.core.BeanResult;
+import org.jboss.seam.xml.core.BeanResultType;
import org.jboss.seam.xml.util.XmlConfigurationException;
+import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
import org.jboss.weld.extensions.util.Reflections;
public class ClassXmlItem extends AbstractXmlItem
@@ -86,4 +96,119 @@
return values;
}
+ public BeanResult<?> createBeanResult()
+ {
+ boolean override = !getChildrenOfType(OverrideXmlItem.class).isEmpty();
+ boolean extend = !getChildrenOfType(ModifiesXmlItem.class).isEmpty();
+ BeanResultType beanType = BeanResultType.ADD;
+ if (override && extend)
+ {
+ throw new XmlConfigurationException("A bean may not both <override> and <extend> an existing bean", getDocument(), getLineno());
+ }
+ if (override)
+ {
+ beanType = BeanResultType.OVERRIDE;
+ }
+ else if (extend)
+ {
+ beanType = BeanResultType.SPECIALISE;
+ }
+
+ // if it is an extend we want to read the annotations from the underlying
+ // class
+ BeanResult<?> result = new BeanResult(getJavaClass(), extend, beanType);
+ AnnotatedTypeBuilder<?> type = result.getBuilder();
+ // list of constructor arguments
+ List<ParameterXmlItem> constList = new ArrayList<ParameterXmlItem>();
+
+ for (AnnotationXmlItem item : getChildrenOfType(AnnotationXmlItem.class))
+ {
+ Annotation a = AnnotationUtils.createAnnotation(item);
+ type.addToClass(a);
+ }
+ List<ParametersXmlItem> constructorParameters = getChildrenOfType(ParametersXmlItem.class);
+ if (constructorParameters.size() > 1)
+ {
+ throw new XmlConfigurationException("A method may only have a single <parameters> element", getDocument(), getLineno());
+ }
+ else if (!constructorParameters.isEmpty())
+ {
+ for (ParameterXmlItem item : constructorParameters.get(0).getChildrenOfType(ParameterXmlItem.class))
+ {
+ constList.add(item);
+ }
+ }
+ for (FieldXmlItem item : getChildrenOfType(FieldXmlItem.class))
+ {
+ for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
+ {
+ Annotation a = AnnotationUtils.createAnnotation(fi);
+ type.addToField(item.getField(), a);
+ }
+ }
+ for (MethodXmlItem item : getChildrenOfType(MethodXmlItem.class))
+ {
+ int paramCount = 0;
+
+ for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
+ {
+ Annotation a = AnnotationUtils.createAnnotation(fi);
+ type.addToMethod(item.getMethod(), a);
+ }
+ List<ParametersXmlItem> parameters = item.getChildrenOfType(ParametersXmlItem.class);
+ if (parameters.size() > 1)
+ {
+ throw new XmlConfigurationException("A method may only have a single <parameters> element", item.getDocument(), item.getLineno());
+ }
+ else if (!parameters.isEmpty())
+ {
+ for (ParameterXmlItem fi : parameters.get(0).getChildrenOfType(ParameterXmlItem.class))
+ {
+ int param = paramCount++;
+ for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
+ {
+ Annotation a = AnnotationUtils.createAnnotation(pan);
+ type.addToMethodParameter(item.getMethod(), param, a);
+ }
+ }
+ }
+
+ }
+
+ if (!constList.isEmpty())
+ {
+ int paramCount = 0;
+ Constructor<?> c = resolveConstructor(constList);
+ // we automatically add inject to the constructor
+ type.addToConstructor((Constructor) c, new AnnotationLiteral<Inject>()
+ {
+ });
+ for (ParameterXmlItem fi : constList)
+ {
+ int param = paramCount++;
+ for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
+ {
+ Annotation a = AnnotationUtils.createAnnotation(pan);
+ type.addToConstructorParameter((Constructor) c, param, a);
+ }
+ }
+ }
+ return result;
+ }
+
+ private Constructor<?> resolveConstructor(List<ParameterXmlItem> constList)
+ {
+ Class<?>[] params = new Class[constList.size()];
+ for (int i = 0; i < constList.size(); ++i)
+ {
+ params[i] = constList.get(i).getJavaClass();
+ }
+ Constructor<?> ret = Reflections.getConstructor(getJavaClass(), params);
+ if (ret == null)
+ {
+ throw new XmlConfigurationException("Could not resolve constructor for " + getJavaClass() + " with arguments " + params, getDocument(), getLineno());
+ }
+ return ret;
+ }
+
}
Modified: modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java
===================================================================
--- modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-17 18:46:05 UTC (rev 13422)
+++ modules/xml/trunk/impl/src/main/java/org/jboss/seam/xml/model/ModelBuilder.java 2010-07-18 03:40:48 UTC (rev 13423)
@@ -22,19 +22,14 @@
package org.jboss.seam.xml.model;
import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
-import java.util.Map.Entry;
import javax.enterprise.inject.Stereotype;
-import javax.enterprise.util.AnnotationLiteral;
-import javax.inject.Inject;
import javax.inject.Qualifier;
import javax.interceptor.InterceptorBinding;
@@ -48,10 +43,6 @@
import org.jboss.seam.xml.parser.namespace.NamespaceElementResolver;
import org.jboss.seam.xml.parser.namespace.RootNamespaceElementResolver;
import org.jboss.seam.xml.util.XmlConfigurationException;
-import org.jboss.seam.xml.util.XmlObjectConverter;
-import org.jboss.weld.extensions.annotated.AnnotatedTypeBuilder;
-import org.jboss.weld.extensions.util.AnnotationInstanceProvider;
-import org.jboss.weld.extensions.util.Reflections;
/**
* Builds an XML result from sax nodes
@@ -62,8 +53,6 @@
public class ModelBuilder
{
- final AnnotationInstanceProvider ac = new AnnotationInstanceProvider();
-
static final String ROOT_NAMESPACE = "urn:java:ee";
static final String BEANS_ROOT_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
@@ -71,12 +60,12 @@
/**
* builds an XML result from a parsed xml document
*/
- public XmlResult build(SaxNode root)
+ public XmlResult build(SaxNode root, String fileUrl)
{
Map<String, NamespaceElementResolver> resolvers = new HashMap<String, NamespaceElementResolver>();
- XmlResult ret = new XmlResult();
+ XmlResult ret = new XmlResult(fileUrl);
if (!root.getName().equals("beans"))
{
@@ -129,7 +118,7 @@
{
ClassXmlItem cxml = (ClassXmlItem) rb;
// get the AnnotatedType information
- BeanResult<?> tp = buildAnnotatedType(cxml);
+ BeanResult<?> tp = cxml.createBeanResult();
ret.addBean(tp);
// <override> or <speciailizes> need to veto the bean
if (tp.getBeanType() != BeanResultType.ADD)
@@ -190,7 +179,7 @@
Set<BeanResult<?>> classes = new HashSet<BeanResult<?>>();
for (ClassXmlItem c : rb.getChildrenOfType(ClassXmlItem.class))
{
- BeanResult<?> br = buildAnnotatedType(c);
+ BeanResult<?> br = c.createBeanResult();
if (br.getBeanType() != BeanResultType.ADD)
{
ret.addVeto(br.getType());
@@ -292,122 +281,6 @@
}
@SuppressWarnings("unchecked")
- BeanResult<?> buildAnnotatedType(ClassXmlItem rb)
- {
- boolean override = !rb.getChildrenOfType(OverrideXmlItem.class).isEmpty();
- boolean extend = !rb.getChildrenOfType(ModifiesXmlItem.class).isEmpty();
- BeanResultType beanType = BeanResultType.ADD;
- if (override && extend)
- {
- throw new XmlConfigurationException("A bean may not both <override> and <extend> an existing bean", rb.getDocument(), rb.getLineno());
- }
- if (override)
- {
- beanType = BeanResultType.OVERRIDE;
- }
- else if (extend)
- {
- beanType = BeanResultType.SPECIALISE;
- }
-
- // if it is an extend we want to read the annotations from the underlying
- // class
- BeanResult<?> result = new BeanResult(rb.getJavaClass(), extend, beanType);
- AnnotatedTypeBuilder<?> type = result.getBuilder();
- // list of constructor arguments
- List<ParameterXmlItem> constList = new ArrayList<ParameterXmlItem>();
-
- for (AnnotationXmlItem item : rb.getChildrenOfType(AnnotationXmlItem.class))
- {
- Annotation a = createAnnotation(item);
- type.addToClass(a);
- }
- List<ParametersXmlItem> constructorParameters = rb.getChildrenOfType(ParametersXmlItem.class);
- if (constructorParameters.size() > 1)
- {
- throw new XmlConfigurationException("A method may only have a single <parameters> element", rb.getDocument(), rb.getLineno());
- }
- else if (!constructorParameters.isEmpty())
- {
- for (ParameterXmlItem item : constructorParameters.get(0).getChildrenOfType(ParameterXmlItem.class))
- {
- constList.add(item);
- }
- }
- for (FieldXmlItem item : rb.getChildrenOfType(FieldXmlItem.class))
- {
- for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
- {
- Annotation a = createAnnotation(fi);
- type.addToField(item.getField(), a);
- }
- }
- for (MethodXmlItem item : rb.getChildrenOfType(MethodXmlItem.class))
- {
- int paramCount = 0;
-
- for (AnnotationXmlItem fi : item.getChildrenOfType(AnnotationXmlItem.class))
- {
- Annotation a = createAnnotation(fi);
- type.addToMethod(item.getMethod(), a);
- }
- List<ParametersXmlItem> parameters = item.getChildrenOfType(ParametersXmlItem.class);
- if (parameters.size() > 1)
- {
- throw new XmlConfigurationException("A method may only have a single <parameters> element", item.getDocument(), item.getLineno());
- }
- else if (!parameters.isEmpty())
- {
- for (ParameterXmlItem fi : parameters.get(0).getChildrenOfType(ParameterXmlItem.class))
- {
- int param = paramCount++;
- for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
- {
- Annotation a = createAnnotation(pan);
- type.addToMethodParameter(item.getMethod(), param, a);
- }
- }
- }
-
- }
-
- if (!constList.isEmpty())
- {
- int paramCount = 0;
- Constructor<?> c = resolveConstructor(rb, constList);
- // we automatically add inject to the constructor
- type.addToConstructor((Constructor) c, new AnnotationLiteral<Inject>()
- {
- });
- for (ParameterXmlItem fi : constList)
- {
- int param = paramCount++;
- for (AnnotationXmlItem pan : fi.getChildrenOfType(AnnotationXmlItem.class))
- {
- Annotation a = createAnnotation(pan);
- type.addToConstructorParameter((Constructor) c, param, a);
- }
- }
- }
- return result;
- }
-
- protected static Constructor<?> resolveConstructor(ClassXmlItem bean, List<ParameterXmlItem> constList)
- {
- Class<?>[] params = new Class[constList.size()];
- for (int i = 0; i < constList.size(); ++i)
- {
- params[i] = constList.get(i).getJavaClass();
- }
- Constructor<?> ret = Reflections.getConstructor(bean.getJavaClass(), params);
- if (ret == null)
- {
- throw new XmlConfigurationException("Could not resolve constructor for " + bean.getJavaClass() + " with arguments " + params, bean.getDocument(), bean.getLineno());
- }
- return ret;
- }
-
- @SuppressWarnings("unchecked")
void addStereotypeToResult(XmlResult ret, XmlItem rb)
{
@@ -417,7 +290,7 @@
{
if (item.getType() == XmlItemType.ANNOTATION)
{
- Annotation a = createAnnotation((AnnotationXmlItem) item);
+ Annotation a = AnnotationUtils.createAnnotation((AnnotationXmlItem) item);
values[count] = a;
}
else
@@ -430,30 +303,6 @@
}
- @SuppressWarnings("unchecked")
- Annotation createAnnotation(AnnotationXmlItem item)
- {
- Map<String, Object> typedVars = new HashMap<String, Object>();
- Class<?> anClass = item.getJavaClass();
- for (Entry<String, String> e : item.getAttributes().entrySet())
- {
- String mname = e.getKey();
- Method m;
- try
- {
- m = anClass.getDeclaredMethod(mname);
- }
- catch (Exception e1)
- {
- throw new XmlConfigurationException("Annotation " + item.getJavaClass().getName() + " does not have a member named " + mname + " ,error in XML", item.getDocument(), item.getLineno());
- }
- Class<?> returnType = m.getReturnType();
- typedVars.put(mname, XmlObjectConverter.convert(returnType, e.getValue()));
- }
-
- return ac.get((Class) item.getJavaClass(), typedVars);
- }
-
public void validateXmlItem(XmlItem item)
{
Set<XmlItemType> allowed = item.getAllowedItem();
14 years, 5 months
Seam SVN: r13422 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management/action and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-07-17 14:46:05 -0400 (Sat, 17 Jul 2010)
New Revision: 13422
Modified:
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java
Log:
group search working by hard coding group type for now
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-17 18:46:05 UTC (rev 13422)
@@ -16,7 +16,7 @@
}
</script>
- <h3>Manage Users</h3>
+ <h3>Manage Groups</h3>
<h:form>
<h:commandButton action="#{groupAction.createGroup}" styleClass="newuser" rendered="#{identity.hasPermission('seam.account', 'create')}"/>
@@ -34,10 +34,16 @@
columnClasses=",,action">
<h:column width="auto">
<f:facet name="header">
- User name
+ Group name
</f:facet>
- #{user.username}
+ #{group.name}
</h:column>
+ <h:column width="auto">
+ <f:facet name="header">
+ Group type
+ </f:facet>
+ #{group.groupType}
+ </h:column>
<h:column id="action" width="auto">
<f:facet name="header">
Action
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java 2010-07-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java 2010-07-17 18:46:05 UTC (rev 13422)
@@ -30,10 +30,8 @@
@Inject public void loadUsers() throws IdentityException, QueryException
{
groups = new ArrayList<GroupDTO>();
-
- GroupQueryBuilder builder = identitySession.createGroupQueryBuilder();
- Collection<Group> results = identitySession.list(builder.createQuery());
+ Collection<Group> results = identitySession.getPersistenceManager().findGroup("GROUP");
for (Group group : results)
{
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java 2010-07-17 17:26:09 UTC (rev 13421)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStore.java 2010-07-17 18:46:05 UTC (rev 13422)
@@ -1278,7 +1278,6 @@
Root<?> root = criteria.from(identityClass);
- Property<?> identityNameProp = modelProperties.get(PROPERTY_IDENTITY_NAME);
Property<?> identityTypeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
List<Predicate> predicates = new ArrayList<Predicate>();
@@ -1292,26 +1291,12 @@
criteria.where(predicates.toArray(new Predicate[0]));
List<?> results = em.createQuery(criteria).getResultList();
-
- Property<?> typeProp = modelProperties.get(PROPERTY_IDENTITY_TYPE);
- Property<?> typeNameProp = modelProperties.get(PROPERTY_IDENTITY_TYPE_NAME);
+ EntityToSpiConverter converter = new EntityToSpiConverter();
+
for (Object result : results)
- {
- String name = (String) identityNameProp.getValue(result);
- String typeName;
-
- if (typeNameProp != null)
- {
- typeName = (String) typeNameProp.getValue(typeProp.getValue(result));
- }
- else
- {
- typeName = (String) typeProp.getValue(result);
- }
-
- IdentityObjectType type = new IdentityObjectTypeImpl(typeName);
- objs.add(new IdentityObjectImpl(name, name, type));
+ {
+ objs.add(converter.convertToIdentityObject(result));
}
return objs;
14 years, 5 months
Seam SVN: r13421 - sandbox/encore/shell.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-17 13:26:09 -0400 (Sat, 17 Jul 2010)
New Revision: 13421
Modified:
sandbox/encore/shell/pom.xml
Log:
unique names
Modified: sandbox/encore/shell/pom.xml
===================================================================
--- sandbox/encore/shell/pom.xml 2010-07-17 17:24:32 UTC (rev 13420)
+++ sandbox/encore/shell/pom.xml 2010-07-17 17:26:09 UTC (rev 13421)
@@ -19,7 +19,7 @@
<!-- CDI Dependencies -->
<dependency>
<groupId>org.jboss.encore</groupId>
- <artifactId>core</artifactId>
+ <artifactId>encore-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
14 years, 5 months
Seam SVN: r13420 - in sandbox/encore: model and 1 other directories.
by seam-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2010-07-17 13:24:32 -0400 (Sat, 17 Jul 2010)
New Revision: 13420
Modified:
sandbox/encore/core/pom.xml
sandbox/encore/model/pom.xml
sandbox/encore/shell/pom.xml
Log:
unique names
Modified: sandbox/encore/core/pom.xml
===================================================================
--- sandbox/encore/core/pom.xml 2010-07-17 11:49:40 UTC (rev 13419)
+++ sandbox/encore/core/pom.xml 2010-07-17 17:24:32 UTC (rev 13420)
@@ -9,7 +9,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>core</artifactId>
+ <artifactId>encore-core</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
Modified: sandbox/encore/model/pom.xml
===================================================================
--- sandbox/encore/model/pom.xml 2010-07-17 11:49:40 UTC (rev 13419)
+++ sandbox/encore/model/pom.xml 2010-07-17 17:24:32 UTC (rev 13420)
@@ -9,7 +9,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>model</artifactId>
+ <artifactId>encore-model</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>
Modified: sandbox/encore/shell/pom.xml
===================================================================
--- sandbox/encore/shell/pom.xml 2010-07-17 11:49:40 UTC (rev 13419)
+++ sandbox/encore/shell/pom.xml 2010-07-17 17:24:32 UTC (rev 13420)
@@ -9,7 +9,7 @@
<relativePath>../pom.xml</relativePath>
</parent>
- <artifactId>shell</artifactId>
+ <artifactId>encore-shell</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>Encore Shell</name>
14 years, 5 months
Seam SVN: r13419 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security and 2 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-07-17 07:49:40 -0400 (Sat, 17 Jul 2010)
New Revision: 13419
Added:
modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupDTO.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
Modified:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/IdentityImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java
Log:
added infrastructure for group management (but doesn't work yet, need to speak to Bolek)
Added: modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml (rev 0)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/managegroups.xhtml 2010-07-17 11:49:40 UTC (rev 13419)
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html"
+ template="/WEB-INF/templates/default.xhtml">
+
+ <ui:define name="sidebar">
+ <ui:include src="menu.xhtml"/>
+ </ui:define>
+
+ <ui:define name="content">
+ <script type="text/javascript">
+ function confirmDelete() {
+ return confirm("Are you sure you wish to delete this group? This action cannot be undone.");
+ }
+ </script>
+
+ <h3>Manage Users</h3>
+
+ <h:form>
+ <h:commandButton action="#{groupAction.createGroup}" styleClass="newuser" rendered="#{identity.hasPermission('seam.account', 'create')}"/>
+ </h:form>
+
+ <h:form>
+ <h:dataTable
+ id="threads"
+ value="#{groupSearch.groups}"
+ var="group"
+ styleClass="security"
+ cellspacing="0"
+ headerClass="header"
+ rowClasses="odd,even"
+ columnClasses=",,action">
+ <h:column width="auto">
+ <f:facet name="header">
+ User name
+ </f:facet>
+ #{user.username}
+ </h:column>
+ <h:column id="action" width="auto">
+ <f:facet name="header">
+ Action
+ </f:facet>
+
+ <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'update')}">
+ <h:commandLink id="edit" value="Edit" action="#{groupAction.editGroup(group.name)}"/>
+ <span> | </span>
+ </ui:fragment>
+ <ui:fragment rendered="#{identity.hasPermission('seam.identity', 'delete')}">
+ <h:commandLink id="delete" value="Delete" action="#{groupAction.deleteGroup(group.name)}" onclick="return confirmDelete()"/>
+ </ui:fragment>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+
+ <br style="clear:both"/>
+
+ </ui:define>
+</ui:composition>
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/IdentityImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/IdentityImpl.java 2010-07-17 10:32:04 UTC (rev 13418)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/IdentityImpl.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -25,9 +25,11 @@
import org.jboss.seam.security.events.PreAuthenticateEvent;
import org.jboss.seam.security.events.PreLoggedOutEvent;
import org.jboss.seam.security.events.QuietLoginEvent;
-import org.jboss.seam.security.management.IdentityManager;
import org.jboss.seam.security.permission.PermissionMapper;
+import org.picketlink.idm.api.Credential;
+import org.picketlink.idm.api.IdentitySession;
import org.picketlink.idm.api.User;
+import org.picketlink.idm.common.exception.IdentityException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -54,7 +56,7 @@
@Inject private Credentials credentials;
@Inject private PermissionMapper permissionMapper;
- @Inject private IdentityManager identityManager;
+ @Inject private IdentitySession identitySession;
@Inject Instance<RequestSecurityState> requestSecurityState;
@@ -226,7 +228,7 @@
}
}
- public void quietLogin()
+ public void quietLogin()
{
try
{
@@ -248,11 +250,12 @@
}
catch (Exception ex)
{
+ log.error("Error authenticating", ex);
credentials.invalidate();
}
}
- protected boolean authenticate()
+ protected boolean authenticate() throws IdentityException
{
try
{
@@ -290,10 +293,11 @@
else
{
// Otherwise if identity management is enabled, use it.
- if (identityManager != null)
+ if (identitySession != null)
{
- success = identityManager.authenticate(credentials.getUsername(),
- credentials.getCredential());
+ success = identitySession.getAttributesManager().validateCredentials(
+ new UserImpl(credentials.getUsername()),
+ new Credential[] {credentials.getCredential()});
if (success)
{
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupAction.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -0,0 +1,48 @@
+package org.jboss.seam.security.management.action;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.Conversation;
+import javax.enterprise.context.ConversationScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+import org.jboss.seam.security.GroupImpl;
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.common.exception.IdentityException;
+
+/**
+ * Action bean for managing groups
+ *
+ * @author Shane Bryzak
+ */
+public @Named @ConversationScoped class GroupAction implements Serializable
+{
+ private static final long serialVersionUID = -1553124158319503903L;
+
+ @Inject Conversation conversation;
+
+ @Inject IdentitySession identitySession;
+
+ private String groupName;
+ private String groupType;
+
+ public void createGroup()
+ {
+ conversation.begin();
+ }
+
+ public void deleteGroup(String name, String groupType) throws IdentityException
+ {
+ Group group = new GroupImpl(name, groupType);
+ identitySession.getPersistenceManager().removeGroup(group, true);
+ }
+
+ public String save() throws IdentityException
+ {
+ identitySession.getPersistenceManager().createGroup(groupName, groupType);
+ conversation.end();
+ return "success";
+ }
+}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupDTO.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupDTO.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupDTO.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -0,0 +1,32 @@
+package org.jboss.seam.security.management.action;
+
+/**
+ * Data transfer object for group information
+ *
+ * @author Shane Bryzak
+ */
+public class GroupDTO
+{
+ private String name;
+ private String groupType;
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setGroupType(String groupType)
+ {
+ this.groupType = groupType;
+ }
+
+ public String getGroupType()
+ {
+ return groupType;
+ }
+}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/GroupSearch.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -0,0 +1,51 @@
+package org.jboss.seam.security.management.action;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import javax.enterprise.inject.Model;
+import javax.inject.Inject;
+
+import org.picketlink.idm.api.Group;
+import org.picketlink.idm.api.IdentitySession;
+import org.picketlink.idm.api.query.GroupQueryBuilder;
+import org.picketlink.idm.api.query.QueryException;
+import org.picketlink.idm.common.exception.IdentityException;
+
+/**
+ * Identity management action bean for searching for groups
+ *
+ * @author Shane Bryzak
+ */
+public @Model class GroupSearch implements Serializable
+{
+ private static final long serialVersionUID = 8592034786339372510L;
+
+ List<GroupDTO> groups;
+
+ @Inject IdentitySession identitySession;
+
+ @Inject public void loadUsers() throws IdentityException, QueryException
+ {
+ groups = new ArrayList<GroupDTO>();
+
+ GroupQueryBuilder builder = identitySession.createGroupQueryBuilder();
+
+ Collection<Group> results = identitySession.list(builder.createQuery());
+
+ for (Group group : results)
+ {
+ GroupDTO dto = new GroupDTO();
+ dto.setName(group.getName());
+ dto.setGroupType(group.getGroupType());
+ groups.add(dto);
+ }
+ }
+
+ public List<GroupDTO> getGroups()
+ {
+ return groups;
+ }
+}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java 2010-07-17 10:32:04 UTC (rev 13418)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/action/UserSearch.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -49,11 +49,6 @@
return sb.toString();
}
- //public String getSelectedUser()
- //{
- //return selectedUser;
- //}
-
public List<UserDTO> getUsers()
{
return users;
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java 2010-07-17 10:32:04 UTC (rev 13418)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java 2010-07-17 11:49:40 UTC (rev 13419)
@@ -34,7 +34,7 @@
public void configure(IdentityStoreConfigurationMetaDataImpl store)
{
- store.setId(id);
+ store.setId(getId());
if (getIdentityStoreClass() != null)
{
14 years, 5 months
Seam SVN: r13418 - in modules/security/trunk: impl/src/main/java/org/jboss/seam/security/management and 1 other directories.
by seam-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2010-07-17 06:32:04 -0400 (Sat, 17 Jul 2010)
New Revision: 13418
Added:
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java
Modified:
modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStoreConfiguration.java
Log:
oops, missed one class.. and made configuration a little simpler
Modified: modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml
===================================================================
--- modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-07-17 10:27:05 UTC (rev 13417)
+++ modules/security/trunk/examples/idmconsole/src/main/webapp/WEB-INF/classes/seam-beans.xml 2010-07-17 10:32:04 UTC (rev 13418)
@@ -42,7 +42,6 @@
<plidm:JpaIdentityStoreConfiguration>
<s:overrides/>
- <plidm:id>jpa</plidm:id>
<plidm:identityClass>org.jboss.seam.security.examples.idmconsole.model.IdentityObject</plidm:identityClass>
<plidm:credentialClass>org.jboss.seam.security.examples.idmconsole.model.IdentityObjectCredential</plidm:credentialClass>
<plidm:relationshipClass>org.jboss.seam.security.examples.idmconsole.model.IdentityObjectRelationship</plidm:relationshipClass>
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-17 10:27:05 UTC (rev 13417)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/IdentityManagerImpl.java 2010-07-17 10:32:04 UTC (rev 13418)
@@ -89,6 +89,7 @@
public boolean enableUser(String name)
{
identity.checkPermission(RESOURCE_IDENTITY, PERMISSION_UPDATE);
+
//return identityStore.enableUser(name);
return false;
}
Added: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java (rev 0)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/IdentityStoreConfiguration.java 2010-07-17 10:32:04 UTC (rev 13418)
@@ -0,0 +1,48 @@
+package org.jboss.seam.security.management.picketlink;
+
+import org.picketlink.idm.impl.configuration.metadata.IdentityStoreConfigurationMetaDataImpl;
+
+/**
+ * Abstract bean for configuring identity stores
+ *
+ * @author Shane Bryzak
+ */
+public abstract class IdentityStoreConfiguration
+{
+ private String id;
+ private Class<?> identityStoreClass;
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ public Class<?> getIdentityStoreClass()
+ {
+ return identityStoreClass;
+ }
+
+ public void setIdentityStoreClass(Class<?> identityStoreClass)
+ {
+ this.identityStoreClass = identityStoreClass;
+ }
+
+ public void configure(IdentityStoreConfigurationMetaDataImpl store)
+ {
+ store.setId(id);
+
+ if (getIdentityStoreClass() != null)
+ {
+ store.setClassName(getIdentityStoreClass().getName());
+ }
+
+ doConfigure(store);
+ }
+
+ public abstract void doConfigure(IdentityStoreConfigurationMetaDataImpl store);
+}
Modified: modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStoreConfiguration.java
===================================================================
--- modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStoreConfiguration.java 2010-07-17 10:27:05 UTC (rev 13417)
+++ modules/security/trunk/impl/src/main/java/org/jboss/seam/security/management/picketlink/JpaIdentityStoreConfiguration.java 2010-07-17 10:32:04 UTC (rev 13418)
@@ -20,6 +20,12 @@
private Class<?> roleNameClass;
private Class<?> attributeClass;
+ @Override
+ public String getId()
+ {
+ return (super.getId() == null) ? "jpa" : super.getId();
+ }
+
/**
* If the identityStoreClass hasn't been set, then return JpaIdentityStore
* by default.
14 years, 5 months