[jboss-cvs] JBossAS SVN: r57790 - in branches/JEE5_TCK/ejb3/src/main/org/jboss: ejb3/client injection
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Oct 24 09:16:56 EDT 2006
Author: thomas.diesler at jboss.com
Date: 2006-10-24 09:16:52 -0400 (Tue, 24 Oct 2006)
New Revision: 57790
Added:
branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java
Removed:
branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java
branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefMethodInjector.java
Modified:
branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java
branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
Log:
Implement @WebServiceRef
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java 2006-10-24 13:08:23 UTC (rev 57789)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientContainer.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -56,6 +56,7 @@
import org.jboss.injection.WebServiceRefHandler;
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
+import org.jboss.util.NotImplementedException;
/**
* Injection of the application client main class is handled from here.
@@ -112,11 +113,11 @@
processMetadata(null);
-// for (EncInjector injector : encInjectors.values())
-// {
-// log.trace("encInjector: " + injector);
-// injector.inject(this);
-// }
+ for (EncInjector injector : encInjectors.values())
+ {
+ log.trace("encInjector: " + injector);
+ injector.inject(this);
+ }
for(Injector injector : injectors)
{
@@ -203,7 +204,7 @@
*/
public String getEjbJndiName(String link, Class businessInterface)
{
- throw new RuntimeException("NYI");
+ throw new NotImplementedException();
//return "java:comp/env/" + link + "/remote";
//return applicationClientName + "/" + link + "/remote";
//return null;
@@ -254,7 +255,7 @@
*/
public String getIdentifier()
{
-// throw new RuntimeException("NYI");
+// throw new NotImplementedException;
// FIXME: return the real identifier
//return "client-identifier";
return applicationClientName;
@@ -265,7 +266,7 @@
*/
public List<Injector> getInjectors()
{
- throw new RuntimeException("NYI");
+ throw new NotImplementedException();
}
public Class<?> getMainClass()
@@ -278,7 +279,7 @@
*/
public PersistenceUnitDeployment getPersistenceUnitDeployment(String unitName) throws NameNotFoundException
{
- throw new RuntimeException("NYI");
+ throw new NotImplementedException();
}
public void invokeMain(String args[]) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
@@ -338,7 +339,6 @@
*/
public Container resolveEjbContainer(String link, Class businessIntf)
{
-// throw new RuntimeException("NYI");
log.warn("resolveEjbContainer(" + link + ", " + businessIntf + ") not implemented");
return null;
}
@@ -348,7 +348,6 @@
*/
public Container resolveEjbContainer(Class businessIntf) throws NameNotFoundException
{
-// throw new RuntimeException("NYI");
return null;
}
}
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java 2006-10-24 13:08:23 UTC (rev 57789)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/ejb3/client/ClientLauncher.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -30,6 +30,7 @@
import org.jboss.ejb3.metamodel.ApplicationClientDD;
import org.jboss.ejb3.metamodel.ApplicationClientDDObjectFactory;
import org.jboss.ejb3.metamodel.JBossClientDDObjectFactory;
+import org.jboss.util.NotImplementedException;
import org.jboss.xb.binding.JBossXBException;
/**
@@ -135,7 +136,7 @@
String name = args[0];
if(name.endsWith(".jar"))
{
- throw new RuntimeException("NYI");
+ throw new NotImplementedException();
// JarFile jarFile = new JarFile(jarName);
}
else
Deleted: branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java 2006-10-24 13:08:23 UTC (rev 57789)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -1,70 +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.injection;
-
-// $Id$
-
-import java.lang.reflect.Field;
-
-import javax.xml.ws.WebServiceRef;
-
-import org.jboss.ejb3.BeanContext;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
-/**
- * Inject a jaxws web service ref.
- *
- * @author Thomas.Diesler at jboss.com
- * @version $Revision$
- */
-public class WebServiceRefFieldInjector implements EncInjector
-{
- private static final Logger log = Logger.getLogger(WebServiceRefFieldInjector.class);
-
- private Field field;
- private String jndiName;
- private WebServiceRef wsref;
-
- public WebServiceRefFieldInjector(Field field, String jndiName, WebServiceRef wsref)
- {
- this.field = field;
- this.field.setAccessible(true);
- this.jndiName = jndiName;
- this.wsref = wsref;
- }
-
- public Class getInjectionClass()
- {
- return field.getType();
- }
-
- public void inject(InjectionContainer container)
- {
- throw new NotImplementedException();
- }
-
- public String toString()
- {
- return super.toString() + "{field=" + field + ",ref=" + wsref + "}";
- }
-}
Modified: branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java 2006-10-24 13:08:23 UTC (rev 57789)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefHandler.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -28,19 +28,12 @@
import java.lang.reflect.Method;
import java.util.Map;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.xml.ws.WebServiceException;
-
import org.jboss.logging.Logger;
import org.jboss.metamodel.descriptor.EnvironmentRefGroup;
import org.jboss.metamodel.descriptor.WebServiceRef;
-import org.jboss.ws.integration.jboss.WebServiceRefDeployer;
/**
- * @author <a href="mailto:bdecoste at jboss.com">William DeCoste</a>
* @author Thomas.Diesler at jboss.com
- * @version <tt>$Revision$</tt>
*/
public class WebServiceRefHandler implements InjectionHandler
{
@@ -81,17 +74,9 @@
encName = "env/" + encName;
}
- String jndiName = ref.mappedName();
- if (jndiName.equals(""))
- {
- jndiName = "/service" + encName.substring(3);
- }
-
- setupWebServiceRef(jndiName, method.getParameterTypes()[0], ref);
-
if (!container.getEncInjectors().containsKey(encName))
{
- container.getEncInjectors().put(encName, new WebServiceRefMethodInjector(method, jndiName, ref));
+ container.getEncInjectors().put(encName, new WebServiceRefInjector(container.getEnc(), encName, method.getParameterTypes()[0], ref));
}
injectors.put(method, new JndiMethodInjector(method, encName, container.getEnc()));
@@ -112,36 +97,11 @@
encName = "env/" + encName;
}
- String jndiName = ref.mappedName();
- if (jndiName.equals(""))
- {
- jndiName = "/service" + encName.substring(3);
- }
-
- setupWebServiceRef(jndiName, field.getType(), ref);
-
if (!container.getEncInjectors().containsKey(encName))
{
- container.getEncInjectors().put(encName, new WebServiceRefFieldInjector(field, jndiName, ref));
+ container.getEncInjectors().put(encName, new WebServiceRefInjector(container.getEnc(), encName, field.getType(), ref));
}
injectors.put(field, new JndiFieldInjector(field, encName, container.getEnc()));
}
-
- private void setupWebServiceRef(String jndiName, Class type, javax.xml.ws.WebServiceRef ref)
- {
- try
- {
- Context ctx = new InitialContext();
- WebServiceRefDeployer.setupWebServiceRef(ctx, jndiName, type, ref);
- }
- catch (RuntimeException rte)
- {
- throw rte;
- }
- catch (Exception ex)
- {
- throw new WebServiceException("Cannot setup @WebServiceRef", ex);
- }
- }
}
Copied: branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java (from rev 57787, branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java)
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefFieldInjector.java 2006-10-24 08:31:14 UTC (rev 57787)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefInjector.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -0,0 +1,73 @@
+/*
+ * 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.injection;
+
+// $Id$
+
+import javax.naming.Context;
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.WebServiceRef;
+
+import org.jboss.logging.Logger;
+import org.jboss.ws.integration.jboss.WebServiceRefDeployer;
+
+/**
+ * Inject a jaxws web service ref.
+ *
+ * @author Thomas.Diesler at jboss.com
+ * @version $Revision$
+ */
+public class WebServiceRefInjector implements EncInjector
+{
+ private static final Logger log = Logger.getLogger(WebServiceRefInjector.class);
+
+ private Context ctx;
+ private String encName;
+ private Class type;
+ private WebServiceRef ref;
+
+ public WebServiceRefInjector(Context ctx, String encName, Class type, WebServiceRef ref)
+ {
+ this.ctx = ctx;
+ this.encName = encName;
+ this.type = type;
+ this.ref = ref;
+ }
+
+ public void inject(InjectionContainer container)
+ {
+ try
+ {
+ WebServiceRefDeployer.setupWebServiceRef(ctx, encName, type, ref);
+ log.debug("@WebServiceRef bound [env=" + encName + ",ref=" + ref.getClass().getName() + "]");
+ }
+ catch (Exception e)
+ {
+ throw new WebServiceException("Unable to bind @WebServiceRef [enc=" + encName + ",type=" + type.getName() + "]", e);
+ }
+ }
+
+ public String toString()
+ {
+ return super.toString() + "{enc=" + encName + ",type=" + type.getName() + "}";
+ }
+}
Deleted: branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefMethodInjector.java
===================================================================
--- branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefMethodInjector.java 2006-10-24 13:08:23 UTC (rev 57789)
+++ branches/JEE5_TCK/ejb3/src/main/org/jboss/injection/WebServiceRefMethodInjector.java 2006-10-24 13:16:52 UTC (rev 57790)
@@ -1,70 +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.injection;
-
-// $Id$
-
-import java.lang.reflect.Method;
-
-import javax.xml.ws.WebServiceRef;
-
-import org.jboss.ejb3.BeanContext;
-import org.jboss.logging.Logger;
-import org.jboss.util.NotImplementedException;
-
-/**
- * Inject a jaxws web service ref.
- *
- * @author Thomas.Diesler at jboss.com
- * @version $Revision$
- */
-public class WebServiceRefMethodInjector implements EncInjector
-{
- private static final Logger log = Logger.getLogger(WebServiceRefMethodInjector.class);
-
- private Method setMethod;
- private String jndiName;
- private WebServiceRef wsref;
-
- public WebServiceRefMethodInjector(Method setMethod, String jndiName, WebServiceRef wsref)
- {
- this.setMethod = setMethod;
- setMethod.setAccessible(true);
- this.jndiName = jndiName;
- this.wsref = wsref;
- }
-
- public Class getInjectionClass()
- {
- return setMethod.getParameterTypes()[0];
- }
-
- public void inject(InjectionContainer container)
- {
- throw new NotImplementedException();
- }
-
- public String toString()
- {
- return super.toString() + "{method=" + setMethod + ",ref=" + wsref + "}";
- }
-}
More information about the jboss-cvs-commits
mailing list