[jboss-cvs] JBossAS SVN: r75257 - projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jul 1 07:57:38 EDT 2008
Author: emuckenhuber
Date: 2008-07-01 07:57:38 -0400 (Tue, 01 Jul 2008)
New Revision: 75257
Added:
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossAspectDomainProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossCacheConfigProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossClusteredProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossConsumerProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossJndiPolicyProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossManagementProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossPoolProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducerProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducersProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossResourceAdapterProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossSerializedConcurrentAccessProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossServiceProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/LocalHomeBindingProcessor.java
projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/RemoteHomeBindingProcessor.java
Log:
[JBMETA-20] additional annotation processors
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossAspectDomainProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossAspectDomainProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossAspectDomainProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.AspectDomain;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+
+/**
+ * The @AspectDomain processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossAspectDomainProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossEnterpriseBeanMetaData, Class<?>>
+{
+
+ protected JBossAspectDomainProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossEnterpriseBeanMetaData metaData, Class<?> type)
+ {
+ AspectDomain annotation = finder.getAnnotation(type, AspectDomain.class);
+ if(annotation == null)
+ return;
+
+ if(annotation.value().length() > 0)
+ metaData.setAopDomainName(annotation.value());
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossCacheConfigProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossCacheConfigProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossCacheConfigProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.CacheConfig;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.CacheConfigMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @CacheConfig processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossCacheConfigProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossSessionBeanMetaData, Class<?>>
+{
+
+ protected JBossCacheConfigProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossSessionBeanMetaData metaData, Class<?> type)
+ {
+ CacheConfig annotation = finder.getAnnotation(type, CacheConfig.class);
+ if(annotation == null)
+ return;
+
+ CacheConfigMetaData cacheConfig = new CacheConfigMetaData();
+ cacheConfig.setMaxSize(annotation.maxSize());
+ cacheConfig.setName(annotation.name());
+
+ cacheConfig.setIdleTimeoutSeconds(Integer.valueOf((int) annotation.idleTimeoutSeconds()));
+ cacheConfig.setRemoveTimeoutSeconds(Integer.valueOf((int) annotation.removalTimeoutSeconds()));
+
+ cacheConfig.setReplicationIsPassivation(Boolean.toString(annotation.replicationIsPassivation()));
+
+ metaData.setCacheConfig(cacheConfig);
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossClusteredProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossClusteredProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossClusteredProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.Clustered;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.creator.ProcessorUtils;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.ClusterConfigMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @Clustered processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossClusteredProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossSessionBeanMetaData, Class<?>>
+{
+
+ protected JBossClusteredProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossSessionBeanMetaData metaData, Class<?> type)
+ {
+ Clustered annotation = finder.getAnnotation(type, Clustered.class);
+ if(annotation == null)
+ return;
+
+ ClusterConfigMetaData clustered = new ClusterConfigMetaData();
+
+ clustered.setBeanLoadBalancePolicy(annotation.loadBalancePolicy());
+ clustered.setHomeLoadBalancePolicy(annotation.homeLoadBalancePolicy());
+ clustered.setPartitionName(annotation.partition());
+ clustered.setDescriptions(ProcessorUtils.getDescription(" @Clustered for bean: " + type));
+
+ metaData.setClusterConfig(clustered);
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossConsumerProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossConsumerProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossConsumerProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import javax.ejb.ActivationConfigProperty;
+
+import org.jboss.ejb3.annotation.Consumer;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossConsumerBeanMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertiesMetaData;
+import org.jboss.metadata.ejb.spec.ActivationConfigPropertyMetaData;
+
+/**
+ * The @Consumer processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossConsumerProcessor extends AbstractEnterpriseBeanProcessor<JBossConsumerBeanMetaData>
+{
+
+ protected JBossConsumerProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ // @Producer(s)
+ addTypeProcessor(new JBossProducerProcessor(finder));
+ addTypeProcessor(new JBossProducersProcessor(finder));
+ }
+
+ @Override
+ protected JBossConsumerBeanMetaData create(Class<?> beanClass)
+ {
+ Consumer annotation = finder.getAnnotation(beanClass, Consumer.class);
+ if(annotation == null)
+ return null;
+
+ JBossConsumerBeanMetaData metaData = new JBossConsumerBeanMetaData();
+ metaData.setEjbClass(beanClass.getName());
+ if(annotation.name().length() > 0)
+ metaData.setEjbName(annotation.name());
+ else
+ metaData.setEjbName(beanClass.getSimpleName());
+
+ ActivationConfigProperty[] props = annotation.activationConfig();
+ ActivationConfigMetaData config = new ActivationConfigMetaData();
+ ActivationConfigPropertiesMetaData configProps = new ActivationConfigPropertiesMetaData();
+ config.setActivationConfigProperties(configProps);
+ for(ActivationConfigProperty prop : props)
+ {
+ ActivationConfigPropertyMetaData acp = new ActivationConfigPropertyMetaData();
+ acp.setActivationConfigPropertyName(prop.propertyName());
+ acp.setValue(prop.propertyValue());
+ configProps.add(acp);
+ }
+ metaData.setActivationConfig(config);
+
+ return metaData;
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossJndiPolicyProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossJndiPolicyProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossJndiPolicyProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.JndiBindingPolicy;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+
+/**
+ * The @JndiBindingPolicy processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossJndiPolicyProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossEnterpriseBeanMetaData, Class<?>>
+{
+
+ protected JBossJndiPolicyProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossEnterpriseBeanMetaData metaData, Class<?> type)
+ {
+ JndiBindingPolicy annotation = finder.getAnnotation(type, JndiBindingPolicy.class);
+ if(annotation == null)
+ return;
+
+ metaData.setJndiBindingPolicy(annotation.policy().getName());
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossManagementProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossManagementProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossManagementProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.Management;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossServiceBeanMetaData;
+
+/**
+ * The @Management processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossManagementProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossServiceBeanMetaData, Class<?>>
+{
+ protected JBossManagementProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossServiceBeanMetaData metaData, Class<?> type)
+ {
+ Management annotation = finder.getAnnotation(type, Management.class);
+ if(annotation == null)
+ return;
+
+ if(annotation.value() != Object.class)
+ metaData.setManagement(annotation.value().getName());
+ }
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossPoolProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossPoolProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossPoolProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.Pool;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeanMetaData;
+import org.jboss.metadata.ejb.jboss.PoolConfigMetaData;
+
+/**
+ * The @Pool processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossPoolProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossEnterpriseBeanMetaData, Class<?>>
+{
+
+ protected JBossPoolProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossEnterpriseBeanMetaData metaData, Class<?> type)
+ {
+ Pool annotation = finder.getAnnotation(type, Pool.class);
+ if(annotation == null)
+ return;
+
+ PoolConfigMetaData poolConfig = new PoolConfigMetaData();
+ poolConfig.setMaxSize(Integer.valueOf(annotation.maxSize()));
+ poolConfig.setTimeout(Integer.valueOf((int) annotation.timeout()));
+ poolConfig.setValue(annotation.value());
+ metaData.setPoolConfig(poolConfig);
+ }
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducerProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducerProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducerProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+import java.util.ArrayList;
+
+import org.jboss.ejb3.annotation.Producer;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossConsumerBeanMetaData;
+import org.jboss.metadata.ejb.jboss.ProducerMetaData;
+
+/**
+ * The @Producer processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossProducerProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossConsumerBeanMetaData, Class<?>>
+{
+
+ protected JBossProducerProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossConsumerBeanMetaData metaData, Class<?> type)
+ {
+ Producer annotation = finder.getAnnotation(type, Producer.class);
+ if(annotation == null)
+ return;
+
+ process(metaData, annotation);
+ }
+
+ protected void process(JBossConsumerBeanMetaData metaData, Producer annotation)
+ {
+ ProducerMetaData producer = new ProducerMetaData();
+ if(annotation.connectionFactory().length() > 1)
+ producer.setConnectionFactory(annotation.connectionFactory());
+ if(annotation.producer() != Object.class)
+ producer.setClassName(annotation.producer().getName());
+
+ // TODO
+ // annotation.transacted();
+ // annotation.acknowledgeMode()
+
+ if(metaData.getProducers() == null)
+ metaData.setProducers(new ArrayList<ProducerMetaData>());
+
+ metaData.getProducers().add(producer);
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducersProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducersProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossProducersProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.Producer;
+import org.jboss.ejb3.annotation.Producers;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossConsumerBeanMetaData;
+
+/**
+ * The @Producers processor
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossProducersProcessor
+ extends JBossProducerProcessor
+ implements Processor<JBossConsumerBeanMetaData, Class<?>>
+
+{
+
+ protected JBossProducersProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ @Override
+ public void process(JBossConsumerBeanMetaData metaData, Class<?> type)
+ {
+ Producers annotation = finder.getAnnotation(type, Producers.class);
+ if(annotation == null)
+ return;
+
+ for(Producer producer : annotation.value())
+ {
+ super.process(metaData, producer);
+ }
+ }
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossResourceAdapterProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossResourceAdapterProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossResourceAdapterProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.ResourceAdapter;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossMessageDrivenBeanMetaData;
+
+/**
+ * The @ResourceAdapter processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossResourceAdapterProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossMessageDrivenBeanMetaData, Class<?>>
+{
+
+ protected JBossResourceAdapterProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossMessageDrivenBeanMetaData metaData, Class<?> type)
+ {
+ ResourceAdapter annotation = finder.getAnnotation(type, ResourceAdapter.class);
+ if(annotation == null)
+ return;
+
+ if(annotation.value().length() > 1)
+ metaData.setResourceAdapterName(annotation.value());
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossSerializedConcurrentAccessProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossSerializedConcurrentAccessProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossSerializedConcurrentAccessProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.SerializedConcurrentAccess;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @SerializedConcurrentAccess processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossSerializedConcurrentAccessProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossSessionBeanMetaData, Class<?>>
+{
+
+ protected JBossSerializedConcurrentAccessProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossSessionBeanMetaData metaData, Class<?> type)
+ {
+ SerializedConcurrentAccess annotation = finder.getAnnotation(type, SerializedConcurrentAccess.class);
+ if(annotation == null)
+ return;
+
+ metaData.setConcurrent(Boolean.TRUE);
+ }
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossServiceProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossServiceProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/JBossServiceProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import javax.ejb.TransactionManagement;
+import javax.ejb.TransactionManagementType;
+
+import org.jboss.ejb3.annotation.Service;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossServiceBeanMetaData;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @Service processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class JBossServiceProcessor extends StatefulProcessor
+{
+
+ protected JBossServiceProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ addTypeProcessor(new JBossManagementProcessor(finder));
+ }
+
+ @Override
+ public JBossSessionBeanMetaData create(Class<?> beanClass)
+ {
+ Service annotation = finder.getAnnotation(beanClass, Service.class);
+ if(annotation == null)
+ return null;
+
+ JBossServiceBeanMetaData bean = new JBossServiceBeanMetaData();
+ bean.setEjbClass(beanClass.getName());
+ String ejbName;
+ if(annotation.name() == null || annotation.name().length() == 0)
+ ejbName = beanClass.getSimpleName();
+ else
+ ejbName = annotation.name();
+ bean.setEjbName(ejbName);
+
+ bean.setObjectName(annotation.objectName());
+ bean.setXmbean(annotation.xmbean());
+
+ TransactionManagement txMgmt = finder.getAnnotation(beanClass, TransactionManagement.class);
+ TransactionManagementType txType = TransactionManagementType.CONTAINER;
+ if(txMgmt != null)
+ txType = txMgmt.value();
+ bean.setTransactionType(txType);
+
+ return bean;
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/LocalHomeBindingProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/LocalHomeBindingProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/LocalHomeBindingProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.LocalHomeBinding;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @LocalHomeBinding processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LocalHomeBindingProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossSessionBeanMetaData, Class<?>>
+{
+
+ protected LocalHomeBindingProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossSessionBeanMetaData metaData, Class<?> type)
+ {
+ LocalHomeBinding annotation = finder.getAnnotation(type, LocalHomeBinding.class);
+ if(annotation == null)
+ return;
+
+ if(annotation.jndiBinding().length() > 1)
+ metaData.setLocalHomeJndiName(annotation.jndiBinding());
+ }
+
+}
+
Added: projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/RemoteHomeBindingProcessor.java
===================================================================
--- projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/RemoteHomeBindingProcessor.java (rev 0)
+++ projects/metadata/trunk/src/main/java/org/jboss/metadata/annotation/creator/ejb/jboss/RemoteHomeBindingProcessor.java 2008-07-01 11:57:38 UTC (rev 75257)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file 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.metadata.annotation.creator.ejb.jboss;
+
+import java.lang.reflect.AnnotatedElement;
+
+import org.jboss.ejb3.annotation.RemoteHomeBinding;
+import org.jboss.metadata.annotation.creator.AbstractFinderUser;
+import org.jboss.metadata.annotation.creator.Processor;
+import org.jboss.metadata.annotation.finder.AnnotationFinder;
+import org.jboss.metadata.ejb.jboss.JBossSessionBeanMetaData;
+
+/**
+ * The @RemoteHomeBinding processor.
+ *
+ * @author <a href="mailto:emuckenh at redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class RemoteHomeBindingProcessor
+ extends AbstractFinderUser
+ implements Processor<JBossSessionBeanMetaData, Class<?>>
+{
+
+ protected RemoteHomeBindingProcessor(AnnotationFinder<AnnotatedElement> finder)
+ {
+ super(finder);
+ }
+
+ public void process(JBossSessionBeanMetaData metaData, Class<?> type)
+ {
+ RemoteHomeBinding annotation = finder.getAnnotation(type, RemoteHomeBinding.class);
+ if(annotation == null)
+ return;
+
+ if(annotation.jndiBinding().length() > 1)
+ metaData.setHomeJndiName(annotation.jndiBinding());
+ }
+}
+
More information about the jboss-cvs-commits
mailing list