You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Sagar Pidaparthi <Sa...@chordiant.com> on 2004/07/29 20:29:39 UTC

Class Loaders and axis

Hi,

I have a situation that requires the use of class loaders for loading my
service classes.  


Reason for writing a class loader:

In my application I have service identified by a tag name MyService
which points to MyServiceClass.  All the application has been developed
for MyServiceClass.  Our clients can extend MyServiceClass to
CustomServiceClass, with enhanced features and point tag name MyService
to CustomServiceClass.  Thus our clients will start using features of
CustomServiceClass, by changes in configuration.  (This was required
over and above the inheritance features provided by OO).  

In the past we had a factory that used to vend the right MyService.
However, with Axis we need to ensure that this trick of loading the
CustomServiceClass should now be done inside a class loader that vends
the right class, when ever MyService is requested using a default
constructor.

Question:

I have two options, one to instantiate the class loader in the
initialization and inspect each class and see if it needs to be loaded
with customized classes.

Or

Use the class loader when ever Axis makes a call to load the classes.
Does axis give me a mechanism to use the class loader whenever it tries
to load classes to generate WSDLs or service the requests etc.  i.e for
all Axis work, I wish to use my class loader and not disturb any of my
existing (mammoth) legacy application.


I would appreciate your help.

Regards

Sagar

Re: Class Loaders and axis

Posted by Davanum Srinivas <da...@gmail.com>.
see ClassUtils.java


----- Original Message -----
From: Sagar Pidaparthi <sa...@chordiant.com>
Date: Thu, 29 Jul 2004 11:29:39 -0700
Subject: Class Loaders and axis
To: axis-user@ws.apache.org

 

Hi, 

I have a situation that requires the use of class loaders for loading
my service classes.
 

Reason for writing a class loader: 

In my application I have service identified by a tag name MyService
which points to MyServiceClass.  All the application has been
developed for MyServiceClass.  Our clients can extend MyServiceClass
to CustomServiceClass, with enhanced features and point tag name
MyService to CustomServiceClass.  Thus our clients will start using
features of CustomServiceClass, by changes in configuration.  (This
was required over and above the inheritance features provided by OO).

In the past we had a factory that used to vend the right MyService. 
However, with Axis we need to ensure that this trick of loading the
CustomServiceClass should now be done inside a class loader that vends
the right class, when ever MyService is requested using a default
constructor.

Question: 

I have two options, one to instantiate the class loader in the
initialization and inspect each class and see if it needs to be loaded
with customized classes.

Or 

Use the class loader when ever Axis makes a call to load the classes. 
Does axis give me a mechanism to use the class loader whenever it
tries to load classes to generate WSDLs or service the requests etc. 
i.e for all Axis work, I wish to use my class loader and not disturb
any of my existing (mammoth) legacy application.
 

I would appreciate your help. 

Regards 

Sagar 



-- 
Davanum Srinivas - http://webservices.apache.org/~dims/