Requirements for practical use?
- Conversion support for recursive references.
- Context driven bean converter(To reduce conversion and transportation overheads)
- Custom pre-processor for the SWX RPC request.(ex. To use a custom interface and an abstract class in the signature.)
- Support for AVM1 and AVM2 assemblers.
- Annotation configuration.
Client side features:
- AS class mapping for DTOs.
- Expression support for recursive references.
SWX Java alpha released!
The alpha version of SWX Java was released on Google code.
This is an alpha test version so that developers and users can find out about SWX Java, and make comments on how to improve it.
Here is a quick guide on how to use SWX Java.
How to use :
- Copy swxjava.jar and json_simple.jar to WEB-INF/lib directory of your web-app.
- Create a service class in java.
- Edit the config files (web.xml and swx.xml).
- web.xml
<web-app id="swx">
<servlet>
<servlet-name>swx-gateway</servlet-name>
<display-name>SWX Gateway Servlet</display-name>
<description>SWX Gateway Servlet</description>
<servlet-class>org.swxjava.servlet.SwxGatewayServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>swx-gateway</servlet-name>
<url-pattern>/swx/*</url-pattern>
</servlet-mapping>
</web-app>- swx.xml under the WEB-INF directory
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE swx PUBLIC “-//DTD SWX Java 0.1//EN”
“http://swxjava.org/dtds/swx-01.dtd”>
<swx>
<allow>
<convert converter=”bean” match=”org.swxjava.examples.*” />
<service name=”TestDataTypes” locator=”new”>
<param name=”class” value=”org.swxjava.examples.TestDataTypes” />
</service>
</allow>
</swx> - Deploy your web app.
- Make swx call.
import org.swxformat.SWX;
// Set up SWX gateway
var swx:SWX = new SWX();
swx.gateway = “http://localhost:8080/YOUR_APP_NAME/swx/gateway”;
swx.debug = true;
var callParameters:Object =
{
serviceClass: “TestDataTypes”,
method: “testArray”,
result: [this, this[”testArrayHandler”]]
}
swx.call(callParameters);
function testArrayHandler(event:Object) {
trace(”Result : ” + event.result);
}
TODO :
- Documentation
- Performance enhancement
- Cool examples
- Support for SWX Tools
- Error handling
- Logging
- Date converter
- AVM2 support
- Annotation
- Context driven JavaBean converter
There is an mailing list on Google groups, if you have any questions and suggestions. You could join swxjava group.
SWX Java is Open Source, available under the MIT License.
Ready to use java data types!
| Java Type | ActionScript type |
|---|---|
| java.lang.Void, void | null |
| Custom class (JavaBean) | Object |
| java.lang.String | String |
| java.lang.Boolean, boolean | Boolean |
| java.lang.Byte, byte | Number |
| java.lang.Short, short | Number |
| java.lang.Integer, int | Number |
| java.lang.Long, long | Number |
| java.lang.Float, float | Number |
| java.lang.Double, double | Number |
| java.lang.Character, char | String |
| java.util.Collection | Array |
| java.util.Map | Object |
| Array | Array |
SWX Java project page just launched!
![]()
I’m happy to announce that swx java project page just launched.
Now, SWX Java assembler and servlet gateway is almost working correctly in my environment. So I will release SWX Java beta in some days.
SWX Java provides cool features to Java developers:
Keep going with SWX!