openamf/src/java/flashgateway/io ASObject.java,1.7,1.8

[email protected] Fri, 15 Aug 2003 20:13:15 -0700
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/src/java/flashgateway/io
In directory sc8-pr-cvs1:/tmp/cvs-serv22941/src/java/flashgateway/io

Modified Files:
	ASObject.java 
Log Message:
use the Thread's context classloader instead of Class.forName(String),
Added some javadocs


Index: ASObject.java
===================================================================
RCS file: /cvsroot/openamf/openamf/src/java/flashgateway/io/ASObject.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ASObject.java	15 Aug 2003 19:25:53 -0000	1.7
--- ASObject.java	16 Aug 2003 03:13:13 -0000	1.8
***************
*** 14,17 ****
--- 14,19 ----
   *
   * @author Jason Calabrese <[email protected]>
+  * @author Sean C. Sullivan
+  * 
   * @version $Revision$, $Date$
   */
***************
*** 41,44 ****
--- 43,49 ----
       *
       * @return
+      * 
+      * @see #setType(String)
+      * 
       */
      public String getType() {
***************
*** 50,53 ****
--- 55,61 ----
       *
       * @param type
+      * 
+      * @see #getType()
+      * 
       */
      public void setType(String type) {
***************
*** 128,139 ****
      /**
       *
!      * @return
       */
      public Object instantiate() {
          Object ret;
          try {
!             ret = Class.forName(type).newInstance();
          } catch (Exception e) {
!             return null;
          }
          return ret;
--- 136,153 ----
      /**
       *
!      * @return this method may return null
!      * 
!      * @see #setType(String)
!      * @see #getType()
!      * 
       */
      public Object instantiate() {
          Object ret;
          try {
!         	ClassLoader loader = Thread.currentThread().getContextClassLoader();
!         	Class clazz = loader.loadClass(type);
!             ret = clazz.newInstance();
          } catch (Exception e) {
!             ret = null;
          }
          return ret;




-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01