openamf/src/java/org/openamf/invoker JavaServiceInvoker.java,1.27,1.28
Sean Sullivan <[email protected]> Sat, 14 Aug 2004 05:25:59 +0000
| Newsgroups | gmane.comp.java.openamf.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/openamf/openamf/src/java/org/openamf/invoker
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19519/src/java/org/openamf/invoker
Modified Files:
JavaServiceInvoker.java
Log Message:
changed the implementation of getPersistService.
Return true if and only if the Java object implements java.io.Serializable
Index: JavaServiceInvoker.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/org/openamf/invoker/JavaServiceInvoker.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** JavaServiceInvoker.java 26 Dec 2003 20:03:36 -0000 1.27
--- JavaServiceInvoker.java 14 Aug 2004 05:25:56 -0000 1.28
***************
*** 43,47 ****
try {
! serviceClass = Thread.currentThread().getContextClassLoader().loadClass(request.getServiceName());
service = getPersistentServiceObject();
if (service == null) {
--- 43,47 ----
try {
! serviceClass = loadClass(request.getServiceName());
service = getPersistentServiceObject();
if (service == null) {
***************
*** 66,70 ****
public boolean getPersistService() {
! return true;
}
--- 66,88 ----
public boolean getPersistService() {
! boolean result = false;
! Class serviceClass = null;
! try
! {
! serviceClass = loadClass(request.getServiceName());
! if (java.io.Serializable.class.isAssignableFrom(serviceClass))
! {
! result = true;
! }
! else
! {
! result = false;
! }
! }
! catch (ClassNotFoundException ex)
! {
! result = false;
! }
! return result;
}
***************
*** 132,135 ****
--- 150,162 ----
}
+ static private Class loadClass(String className) throws ClassNotFoundException
+ {
+ Class cl = null;
+
+ cl = Thread.currentThread().getContextClassLoader().loadClass(className);
+
+ return cl;
+ }
+
public boolean supports(ServiceRequest request) {
if (request!=null) {
***************
*** 138,142 ****
boolean supports = false;
try {
! Thread.currentThread().getContextClassLoader().loadClass(request.getServiceName());
supports = true;
} catch (Exception e) {
--- 165,169 ----
boolean supports = false;
try {
! loadClass(request.getServiceName());
supports = true;
} catch (Exception e) {
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285