[jboss-cvs] JBossAS SVN: r59693 - in trunk: ejb3/src/main/org/jboss/ejb3 and 6 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Jan 17 11:00:28 EST 2007
Author: thomas.diesler at jboss.com
Date: 2007-01-17 11:00:28 -0500 (Wed, 17 Jan 2007)
New Revision: 59693
Removed:
trunk/ejb3/src/main/org/jboss/ejb3/DeployableContainer.java
Modified:
trunk/ejb3/.classpath
trunk/ejb3/src/main/org/jboss/ejb3/DeploymentUnit.java
trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
trunk/ejb3/src/main/org/jboss/ejb3/JmxDeploymentUnit.java
trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentUnit.java
trunk/ejb3/src/main/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java
trunk/ejb3/src/main/org/jboss/injection/InjectionContainer.java
trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
trunk/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java
trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/TomcatInjectionContainer.java
Log:
Use deployment root VirtualFile in @WebServiceRef handling
Modified: trunk/ejb3/.classpath
===================================================================
--- trunk/ejb3/.classpath 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/.classpath 2007-01-17 16:00:28 UTC (rev 59693)
@@ -92,5 +92,7 @@
<classpathentry kind="lib" path="/thirdparty/jboss/aop/lib/jboss-aop-jdk50.jar"/>
<classpathentry kind="lib" path="src/resources/test"/>
<classpathentry kind="lib" path="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs.jar" sourcepath="/thirdparty/jboss/jboss-vfs/lib/jboss-vfs-sources.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jboss-jaxws.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/jboss/jbossws/lib/jboss-saaj.jar"/>
<classpathentry kind="output" path="output/eclipse-classes"/>
</classpath>
Deleted: trunk/ejb3/src/main/org/jboss/ejb3/DeployableContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/DeployableContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/DeployableContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -1,35 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* 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.ejb3;
-
-// $Id$
-
-/**
- * Interface implemented by Containers that were created through deployment.
- *
- * @author Thomas.Diesler at jboss.com
- * @version $Revision$
- */
-public interface DeployableContainer
-{
- DeploymentUnit getDeploymentUnit();
-}
Modified: trunk/ejb3/src/main/org/jboss/ejb3/DeploymentUnit.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/DeploymentUnit.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/DeploymentUnit.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -66,4 +66,6 @@
URL getRelativeURL(String path);
VirtualFile getMetaDataFile(String string);
+
+ VirtualFile getRootFile();
}
Modified: trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/EJBContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -81,6 +81,7 @@
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
import org.jboss.naming.Util;
+import org.jboss.virtual.VirtualFile;
/**
* Comment
@@ -88,7 +89,7 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision$
*/
-public abstract class EJBContainer extends ClassContainer implements Container, InjectionContainer, DeployableContainer
+public abstract class EJBContainer extends ClassContainer implements Container, InjectionContainer
{
private static final Logger log = Logger.getLogger(EJBContainer.class);
@@ -248,6 +249,11 @@
this.jaccContextId = jaccContextId;
}
+ public VirtualFile getRootFile()
+ {
+ return getDeploymentUnit().getRootFile();
+ }
+
public DeploymentUnit getDeploymentUnit()
{
return deployment.getDeploymentUnit();
Modified: trunk/ejb3/src/main/org/jboss/ejb3/JmxDeploymentUnit.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/JmxDeploymentUnit.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/JmxDeploymentUnit.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -69,6 +69,11 @@
}
}
+ public VirtualFile getRootFile()
+ {
+ return vfsRoot;
+ }
+
public URL getRelativeURL(String jar)
{
URL url = null;
Modified: trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -40,7 +40,6 @@
import javax.naming.NameNotFoundException;
import javax.naming.NamingEnumeration;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ejb3.Container;
import org.jboss.ejb3.DependencyPolicy;
import org.jboss.ejb3.entity.PersistenceUnitDeployment;
@@ -61,6 +60,7 @@
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
import org.jboss.util.NotImplementedException;
+import org.jboss.virtual.VirtualFile;
/**
* Injection of the application client main class is handled from here.
@@ -412,4 +412,9 @@
{
return null;
}
+
+ public VirtualFile getRootFile()
+ {
+ throw new NotImplementedException();
+ }
}
Modified: trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/clientmodule/ClientENCInjectionContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -39,7 +39,6 @@
import org.jboss.ejb3.Container;
import org.jboss.ejb3.DependencyPolicy;
-import org.jboss.ejb3.DeployableContainer;
import org.jboss.ejb3.DeploymentScope;
import org.jboss.ejb3.DeploymentUnit;
import org.jboss.ejb3.Ejb3Module;
@@ -63,6 +62,7 @@
import org.jboss.injection.WebServiceRefHandler;
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
+import org.jboss.virtual.VirtualFile;
/**
* This class builds up the java:comp namespace for JavaEE 5 application clients.
@@ -71,7 +71,7 @@
* @author <a href="mailto:carlo.dewolf at jboss.com">Carlo de Wolf</a>
* @version $Revision$
*/
-public class ClientENCInjectionContainer implements InjectionContainer, DeployableContainer
+public class ClientENCInjectionContainer implements InjectionContainer
{
private static final Logger log = Logger.getLogger(ClientENCInjectionContainer.class);
@@ -184,9 +184,9 @@
return field.getAnnotation(annotationType);
}
- public DeploymentUnit getDeploymentUnit()
+ public VirtualFile getRootFile()
{
- return ejb3Unit;
+ return ejb3Unit.getRootFile();
}
public ClassLoader getClassloader()
Modified: trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentUnit.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentUnit.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/deployers/JBoss5DeploymentUnit.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -55,6 +55,11 @@
this.unit = unit;
}
+ public VirtualFile getRootFile()
+ {
+ return unit.getDeploymentContext().getRoot();
+ }
+
public URL getRelativeURL(String jar)
{
try
Modified: trunk/ejb3/src/main/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/ejb3/embedded/EJB3StandaloneDeployer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -105,6 +105,11 @@
}
}
+ public VirtualFile getRootFile()
+ {
+ return vfsRoot;
+ }
+
public URL getRelativeURL(String jar)
{
URL url = null;
Modified: trunk/ejb3/src/main/org/jboss/injection/InjectionContainer.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/InjectionContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/injection/InjectionContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -35,6 +35,7 @@
import org.jboss.ejb3.DependencyPolicy;
import org.jboss.ejb3.entity.PersistenceUnitDeployment;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
+import org.jboss.virtual.VirtualFile;
/**
* This is the container that manages all injections. Could be an EJB Container
@@ -61,6 +62,8 @@
// EncInjectors/Handlers may need to add extra instance injectors
List<Injector> getInjectors();
+
+ VirtualFile getRootFile();
Context getEnc();
Modified: trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -33,7 +33,6 @@
import javax.xml.ws.WebServiceRef;
import javax.xml.ws.WebServiceRefs;
-import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
import org.jboss.metamodel.descriptor.ServiceRef;
Modified: trunk/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java
===================================================================
--- trunk/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -24,7 +24,6 @@
// $Id$
import java.io.IOException;
-import java.net.URL;
import javax.management.MBeanServer;
import javax.management.ObjectName;
@@ -35,14 +34,13 @@
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceRef;
-import org.jboss.ejb3.DeployableContainer;
-import org.jboss.ejb3.DeploymentUnit;
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.ServiceRef;
import org.jboss.mx.util.MBeanProxy;
import org.jboss.mx.util.MBeanServerLocator;
import org.jboss.mx.util.ObjectNameFactory;
import org.jboss.util.xml.DOMUtils;
+import org.jboss.virtual.VirtualFile;
import org.w3c.dom.Element;
/**
@@ -70,7 +68,7 @@
public interface WebServiceRefHandlerMBean
{
ObjectName OBJECT_NAME = ObjectNameFactory.create("jboss.ws:service=WebServiceRefHandler");
- void setupWebServiceRef(Context encCtx, String encName, Class refType, WebServiceRef wsref, URL rootURL, Source metadata) throws NamingException;
+ void setupWebServiceRef(Context encCtx, String encName, Class refType, WebServiceRef wsref, VirtualFile vfsRoot, Source metadata) throws NamingException;
}
public WebServiceRefInjector(String name, Class refType, WebServiceRef wsref, ServiceRef sref)
@@ -86,19 +84,14 @@
{
try
{
- URL rootURL = null;
Context encCtx = container.getEnc();
- if (container instanceof DeployableContainer)
- {
- DeploymentUnit ejb3Unit = ((DeployableContainer)container).getDeploymentUnit();
- rootURL = ejb3Unit.getUrl();
- }
+ VirtualFile vfsRoot = container.getRootFile();
// Decoupled invocation to JBossWS
MBeanServer server = MBeanServerLocator.locateJBoss();
ObjectName oname = WebServiceRefHandlerMBean.OBJECT_NAME;
WebServiceRefHandlerMBean handler = (WebServiceRefHandlerMBean)MBeanProxy.get(WebServiceRefHandlerMBean.class, oname, server);
- handler.setupWebServiceRef(encCtx, name, refType, wsref, rootURL, getMetaData());
+ handler.setupWebServiceRef(encCtx, name, refType, wsref, vfsRoot, getMetaData());
log.debug("@WebServiceRef bound [env=" + name + ",ref=" + refTypeName + "]");
}
Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/TomcatInjectionContainer.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/TomcatInjectionContainer.java 2007-01-17 15:51:07 UTC (rev 59692)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/TomcatInjectionContainer.java 2007-01-17 16:00:28 UTC (rev 59693)
@@ -41,13 +41,11 @@
import javax.naming.NamingException;
import org.apache.AnnotationProcessor;
+import org.jboss.deployers.spi.deployer.DeploymentUnit;
import org.jboss.ejb3.Container;
import org.jboss.ejb3.DependencyPolicy;
-import org.jboss.ejb3.DeployableContainer;
import org.jboss.ejb3.DeploymentScope;
-import org.jboss.ejb3.DeploymentUnit;
import org.jboss.ejb3.JmxDependencyPolicy;
-import org.jboss.ejb3.deployers.JBoss5DeploymentUnit;
import org.jboss.ejb3.enc.DeploymentPersistenceUnitResolver;
import org.jboss.ejb3.entity.PersistenceUnitDeployment;
import org.jboss.injection.DependsHandler;
@@ -80,7 +78,7 @@
* @author <a href="mailto:bill at jboss.org">Bill Burke</a>
* @version $Revision: 1.17 $
*/
-public class TomcatInjectionContainer implements InjectionContainer, AnnotationProcessor, DeployableContainer
+public class TomcatInjectionContainer implements InjectionContainer, AnnotationProcessor
{
private static final Logger log = Logger.getLogger(TomcatInjectionContainer.class);
@@ -127,13 +125,13 @@
protected WarEjbResolver ejbResolver;
protected DependencyPolicy dependencyPolicy = new JmxDependencyPolicy();
protected Collection<InjectionHandler> handlers;
- protected DeploymentUnit ejb3Unit;
+ protected DeploymentUnit unit;
protected ClassLoader webLoader;
protected WebApplication appInfo;
- public TomcatInjectionContainer(WebApplication appInfo, org.jboss.deployers.spi.deployer.DeploymentUnit unit)
+ public TomcatInjectionContainer(WebApplication appInfo, DeploymentUnit unit)
{
- this.ejb3Unit = new JBoss5DeploymentUnit(unit);
+ this.unit = unit;
DeploymentScope deploymentScope = null;
this.appInfo = appInfo;
@@ -216,7 +214,7 @@
try
{
- VirtualFile webDD = ejb3Unit.getMetaDataFile("web.xml");
+ VirtualFile webDD = unit.getMetaDataFile("web.xml");
if (webDD != null)
webIS = webDD.openStream();
}
@@ -226,7 +224,7 @@
}
try
{
- VirtualFile webDD = ejb3Unit.getMetaDataFile("jboss-web.xml");
+ VirtualFile webDD = unit.getMetaDataFile("jboss-web.xml");
if (webDD != null)
jbossWebIS = webDD.openStream();
}
@@ -364,14 +362,14 @@
return new ArrayList<Injector>(); // no equivalent in WAR
}
- public DeploymentUnit getDeploymentUnit()
+ public VirtualFile getRootFile()
{
- return ejb3Unit;
+ return unit.getDeploymentContext().getRoot();
}
-
+
public String getIdentifier()
{
- return ejb3Unit.getShortName();
+ return unit.getSimpleName();
}
public String getDeploymentDescriptorType()
More information about the jboss-cvs-commits
mailing list