Author: richard.opalka(a)jboss.com
Date: 2009-05-05 08:50:22 -0400 (Tue, 05 May 2009)
New Revision: 9961
Removed:
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/EJBBeanReferenceResolver.java
Modified:
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
container/jboss50/branches/jboss500/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
Log:
[JBWS-2634] EjbReferenceResolver available on AS 5.0.1 and above only
Deleted:
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/EJBBeanReferenceResolver.java
===================================================================
---
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/EJBBeanReferenceResolver.java 2009-05-05
12:20:45 UTC (rev 9960)
+++
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/EJBBeanReferenceResolver.java 2009-05-05
12:50:22 UTC (rev 9961)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, 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.wsf.container.jboss50.deployment.metadata;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-
-import javax.ejb.EJB;
-
-import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.resolvers.spi.EjbReference;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
-import org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver;
-
-/**
- * EJB reference resolver.
- *
- * @author <a href="mailto:richard.opalka@jboss.org">Richard
Opalka</a>
- */
-final class EJBBeanReferenceResolver extends AbstractReferenceResolver<EJB>
-{
-
- /**
- * Deployment unit used for resolving process.
- */
- private final DeploymentUnit unit;
- /**
- * Delegate used to resolve JNDI names.
- */
- private final EjbReferenceResolver delegate;
-
- /**
- * Constructor.
- */
- EJBBeanReferenceResolver(final DeploymentUnit unit, final EjbReferenceResolver
delegate)
- {
- super(EJB.class);
-
- if (unit == null)
- {
- throw new IllegalArgumentException("Deployment unit cannot be null");
- }
- if (delegate == null)
- {
- throw new IllegalArgumentException("Ejb reference resolver cannot be
null");
- }
-
- this.unit = unit;
- this.delegate = delegate;
- }
-
- /* (non-Javadoc)
- * @see
org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveField(java.lang.reflect.Field)
- */
- @Override
- protected String resolveField(final Field field)
- {
- final EJB ejbAnnotation = field.getAnnotation(EJB.class);
- final Class<?> type = field.getType();
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
-
- return this.delegate.resolveEjb(unit, reference);
- }
-
- /* (non-Javadoc)
- * @see
org.jboss.wsf.common.injection.resolvers.AbstractReferenceResolver#resolveMethod(java.lang.reflect.Method)
- */
- @Override
- protected String resolveMethod(final Method method)
- {
- final EJB ejbAnnotation = method.getAnnotation(EJB.class);
- final Class<?> type = method.getParameterTypes()[0];
- final EjbReference reference = getEjbReference(ejbAnnotation, type);
-
- return this.delegate.resolveEjb(unit, reference);
- }
-
- /**
- * Constructs EjbReference.
- *
- * @param ejbAnnotation ejb annotation
- * @param type fall back type
- * @return ejb reference instance
- */
- private EjbReference getEjbReference(EJB ejbAnnotation, Class<?> type)
- {
- String beanInterface = ejbAnnotation.beanInterface().getName();
- if (java.lang.Object.class.getName().equals(beanInterface))
- {
- beanInterface = type.getName();
- }
- return new EjbReference(ejbAnnotation.beanName(), beanInterface,
ejbAnnotation.mappedName());
- }
-
-}
Modified:
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java
===================================================================
---
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-05-05
12:20:45 UTC (rev 9960)
+++
container/jboss50/branches/jboss500/src/main/java/org/jboss/wsf/container/jboss50/deployment/metadata/InjectionMetaDataDeploymentAspect.java 2009-05-05
12:50:22 UTC (rev 9961)
@@ -31,14 +31,12 @@
import java.util.Set;
import javax.annotation.Resource;
-import javax.ejb.EJB;
import javax.jws.WebService;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.xml.ws.WebServiceProvider;
import org.jboss.deployers.structure.spi.DeploymentUnit;
-import org.jboss.ejb3.common.resolvers.spi.EjbReferenceResolver;
import org.jboss.metadata.ejb.jboss.JBossEnterpriseBeansMetaData;
import org.jboss.metadata.ejb.jboss.JBossMetaData;
import org.jboss.metadata.javaee.spec.EnvironmentEntriesMetaData;
@@ -66,7 +64,6 @@
private static final ReferenceResolver RESOURCE_REFERENCE_RESOLVER = new
ResourceReferenceResolver();
private static final String EJB3_JNDI_PREFIX = "java:env/";
- private EjbReferenceResolver ejbReferenceResolver;
@Override
public void create(Deployment dep)
@@ -144,7 +141,6 @@
{
final Map<Class<? extends Annotation>, ReferenceResolver> resolvers =
new HashMap<Class<? extends Annotation>, ReferenceResolver>();
resolvers.put(Resource.class, RESOURCE_REFERENCE_RESOLVER);
- resolvers.put(EJB.class, new EJBBeanReferenceResolver(unit,
getEjbReferenceResolver()));
return resolvers;
}
@@ -207,29 +203,4 @@
return isWebService || isWebServiceProvider;
}
- /**
- * Sets ejb reference resolver. This method is invoked by MC.
- *
- * @param resolver ejb reference resolver
- */
- public void setEjbReferenceResolver(final EjbReferenceResolver resolver)
- {
- this.ejbReferenceResolver = resolver;
- }
-
- /**
- * Gets ejb reference resolver.
- *
- * @return ejb reference resolver
- */
- public EjbReferenceResolver getEjbReferenceResolver()
- {
- if (this.ejbReferenceResolver == null)
- {
- throw new IllegalStateException("No EjbReferenceResolver set by MC");
- }
-
- return this.ejbReferenceResolver;
- }
-
}
Modified:
container/jboss50/branches/jboss500/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml
===================================================================
---
container/jboss50/branches/jboss500/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-05-05
12:20:45 UTC (rev 9960)
+++
container/jboss50/branches/jboss500/src/main/resources/jbossws-jboss50.deployer/META-INF/jbossws-deployer-jboss-beans.xml 2009-05-05
12:50:22 UTC (rev 9961)
@@ -172,8 +172,8 @@
</uninstall>
<depends>WebServiceDeployerEJB</depends>
</bean>
-
- <!--
+
+ <!--
Each DeploymentAspectManger maintains a list of DeploymentAspects
-->
<bean name="WSDeploymentAspectManagerPreJSE"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
@@ -189,25 +189,24 @@
<bean name="WSDeploymentAspectManagerEndpointAPI"
class="org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl">
<property
name="name">WSDeploymentAspectManagerEndpointAPI</property>
</bean>
-
- <!--
+
+ <!--
The container deployment aspects
-->
<bean name="WSContainerMetaDataDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.metadata.ContainerMetaDataDeploymentAspect">
<property name="provides">ContainerMetaData,
VFSRoot</property>
</bean>
-
+
<bean name="WSInjectionMetaDataDeploymentAspect"
class="org.jboss.wsf.container.jboss50.deployment.metadata.InjectionMetaDataDeploymentAspect">
<property name="requires">WebMetaData</property>
<property name="provides">InjectionMetaData</property>
- <property name="ejbReferenceResolver"><inject
bean="org.jboss.ejb3.EjbReferenceResolver"/></property>
- </bean>
+ </bean>
<bean name="WSContextRootDeploymentAspect"
class="org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">ContextRoot</property>
</bean>
-
+
<bean name="WSVirtualHostDeploymentAspect"
class="org.jboss.wsf.framework.deployment.VirtualHostDeploymentAspect">
<property name="requires">ContainerMetaData</property>
<property name="provides">VirtualHosts</property>