Author: richard.opalka(a)jboss.com
Date: 2010-03-30 04:49:18 -0400 (Tue, 30 Mar 2010)
New Revision: 11885
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
Log:
[JBWS-2970] every endpoint will provide associated JNDI context at runtime, not at
deployment time
Modified:
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java
===================================================================
---
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-03-30
08:46:06 UTC (rev 11884)
+++
framework/trunk/src/main/java/org/jboss/wsf/framework/deployment/DefaultEndpoint.java 2010-03-30
08:49:18 UTC (rev 11885)
@@ -27,7 +27,10 @@
import javax.management.ObjectName;
import javax.management.MalformedObjectNameException;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import org.jboss.wsf.common.injection.InjectionException;
import org.jboss.wsf.common.injection.PreDestroyHolder;
import org.jboss.wsf.spi.deployment.AbstractExtensible;
import org.jboss.wsf.spi.deployment.Endpoint;
@@ -65,9 +68,6 @@
DefaultEndpoint(String targetBean)
{
- //if(null==targetBean)
- // throw new IllegalArgumentException("targetBean name cannot be
null");
-
this.targetBean = targetBean;
this.state = EndpointState.UNDEFINED;
}
@@ -106,22 +106,13 @@
public synchronized Class<?> getTargetBeanClass()
{
+ if (targetBean == null)
+ throw new IllegalStateException("Target bean not set");
if (targetBeanClass != null)
return targetBeanClass;
- if (targetBean == null)
- throw new IllegalStateException("Target bean not set");
ClassLoader classLoader = service.getDeployment().getRuntimeClassLoader();
- if (classLoader == null)
- {
- // TODO: IMO this is an exception
- classLoader = service.getDeployment().getInitialClassLoader();
- }
-
- if (classLoader == null)
- throw new IllegalStateException("Deployment classloader not set");
-
try
{
targetBeanClass = classLoader.loadClass(targetBean);
@@ -130,6 +121,7 @@
{
throw new WSFDeploymentException(ex);
}
+
return targetBeanClass;
}
@@ -315,4 +307,23 @@
}
}
}
+
+ @Override
+ public Context getJNDIContext()
+ {
+ Context retVal = null;
+
+ try
+ {
+ retVal = this.getInvocationHandler().getJNDIContext(this);
+ }
+ catch (NamingException e)
+ {
+ final String message = "Cannot get JNDI context";
+ InjectionException.rethrow(message, e);
+ }
+
+ return retVal;
+ }
+
}
Show replies by date