Author: robertlazarski
Date: Mon Jul 17 06:52:56 2006
New Revision: 422718
URL: http://svn.apache.org/viewvc?rev=422718&view=rev
Log:
Minor code and doc changes for Spring support
Modified:
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.java
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringServletContextObjectSupplier.java
webservices/axis2/trunk/java/xdocs/latest/index.html
webservices/axis2/trunk/java/xdocs/latest/spring.html
Modified:
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.java
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.java?rev=422718&r1=422717&r2=422718&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.java
(original)
+++
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/ApplicationContextHolder.java
Mon Jul 17 06:52:56 2006
@@ -21,12 +21,9 @@
import org.springframework.context.ApplicationContextAware;
/** Implementation of a Spring interface who is configured in Spring's
- * applicationContext.xml or some other Spring type of way. The
- * ApplicationContext value is injected on Spring startup, and therefore,
- * this class must be present at least in WEB-INF/lib.
- * This ApplicationContext object has all the Spring beans which can be
accessed
- * by bean name, ie, appCtx.getBean(beanName) . This is the main glue between
axis2
- * and Spring.
+ * applicationContext.xml or some other Spring type of way. This class
+ * and the spring bean needed to wire it could be used as an alternative
+ * to getting the ApplicationContext from the ServletContext.
*/
public class ApplicationContextHolder implements ApplicationContextAware {
Modified:
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java?rev=422718&r1=422717&r2=422718&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java
(original)
+++
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringAppContextAwareObjectSupplier.java
Mon Jul 17 06:52:56 2006
@@ -26,13 +26,13 @@
import javax.servlet.ServletContext;
import org.springframework.context.ApplicationContext;
-import org.springframework.web.context.support.WebApplicationContextUtils;
public class SpringAppContextAwareObjectSupplier {
public static final String SERVICE_SPRING_BEANNAME = "SpringBeanName";
/**
- * Method getServiceObject that is Spring aware via ServletContext
+ * Method getServiceObject that is Spring aware via Spring interface
+ * ApplicationContextAware.
*
* @param msgContext
* @return Returns Object.
Modified:
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringServletContextObjectSupplier.java
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringServletContextObjectSupplier.java?rev=422718&r1=422717&r2=422718&view=diff
==============================================================================
---
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringServletContextObjectSupplier.java
(original)
+++
webservices/axis2/trunk/java/modules/spring/src/org/apache/axis2/extensions/spring/receivers/SpringServletContextObjectSupplier.java
Mon Jul 17 06:52:56 2006
@@ -32,7 +32,7 @@
public static final String SERVICE_SPRING_BEANNAME = "SpringBeanName";
/**
- * Method getServiceObject that is Spring aware via ServletContext
+ * Method getServiceObject that is Spring aware via ServletContext.
*
* @param msgContext
* @return Returns Object.
@@ -54,7 +54,8 @@
if (servletContext == null) {
throw new Exception("Axis2 Can't find ServletContext");
}
- ApplicationContext aCtx =
WebApplicationContextUtils.getWebApplicationContext(servletContext);
+ ApplicationContext aCtx =
+
WebApplicationContextUtils.getWebApplicationContext(servletContext);
if (aCtx == null) {
throw new Exception("Axis2 Can't find Spring's
ApplicationContext");
} else if (aCtx.getBean(beanName) == null) {
Modified: webservices/axis2/trunk/java/xdocs/latest/index.html
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/index.html?rev=422718&r1=422717&r2=422718&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/index.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/index.html Mon Jul 17 06:52:56
2006
@@ -175,6 +175,10 @@
<td><a href="http-transport.html">HTTP Transports</a></td>
<td>Description on HTTP sender and HTTP receiver in Axis2</td>
</tr>
+ <tr>
+ <td><a href="spring.html">Spring Framework</a></td>
+ <td>Guide on how to use Axis2 with the Spring Framework</td>
+ </tr>
</tbody>
</table>
<br>
Modified: webservices/axis2/trunk/java/xdocs/latest/spring.html
URL:
http://svn.apache.org/viewvc/webservices/axis2/trunk/java/xdocs/latest/spring.html?rev=422718&r1=422717&r2=422718&view=diff
==============================================================================
--- webservices/axis2/trunk/java/xdocs/latest/spring.html (original)
+++ webservices/axis2/trunk/java/xdocs/latest/spring.html Mon Jul 17 06:52:56
2006
@@ -17,9 +17,9 @@
part of the Axis2 standard distrubution: One for use with a servlet container,
and one
without. Once configured, the web service itself acts like any other Spring
wired bean.
No further spring configuration is necessary. These Spring beans can be loaded
any way
-desired, as Axis2 has no file dependencies from Spring. Spring versions 1.2.6
and 1.2.8
-have been tested, but probably any version would work as only core
functionality is
-required.</p>
+desired, as Axis2 has no configuration file dependencies from Spring. Spring
versions
+1.2.6 and 1.2.8 have been tested, but probably any version would work as only
core
+functionality is required.</p>
<p>This guide assumes some basic knowledge of Axis2. See the userguide for
more info.</p>
@@ -45,12 +45,12 @@
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
- <!-- Axis2 Web Service, but to Spring, its just another interface / bean
that has dependencies -->
+ <!-- Axis2 Web Service, but to Spring, its just another bean that has
dependencies -->
<bean id="springAwareService" class="spring.SpringAwareService">
<property name="myBean" ref="myBean"/>
</bean>
- <!-- just another bean with a wired implementation, that's injected by
Spring
+ <!-- just another bean / interface with a wired implementation, that's
injected by Spring
into the Web Service -->
<bean id="myBean" class="spring.MyBeanImpl">
<property name="val" value="Spring, emerge thyself" />
@@ -59,7 +59,8 @@
</pre>
<p> In the case Axis2 can't get a ServletContext, you have the option of
defining a bean that takes
-advantage of Spring's internal abilities to provide an Application Context,
with a bean ref 'applicationContext' :
+advantage of Spring's internal abilities (ApplicationContextAware interface,
specifically) to
+provide an Application Context to Axis2, with a bean ref 'applicationContext' :
<pre><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">
@@ -233,7 +234,10 @@
}
}
} </pre>
-<p>To run this example, make sure you have the axis2-spring*.jar in the server
side WEB-INF/lib . Running the client, you should see this output:</p>
+<p>To run this example, make sure you have the axis2-spring*.jar that comes
from the axis2-std-*-bin distro
+in the server side WEB-INF/lib, as well as the appropriate Spring jar - most
will use the full spring.jar,
+but the minimun requirements are spring-core, spring-beans, spring-context and
spring-web. Running the
+client, you should see this output:</p>
<pre>
Response: <example1:string
xmlns:example1="http://springExample.org/example1"
xmlns:tns="http://ws.apache.org/axis2">Spring, emerge
thyself</example1:string>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]