aspose file tools*
The moose likes Web Services and the fly likes Axis2 - could axis instantiate a Service through Factory, instead of Constructor ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis2 - could axis instantiate a Service through Factory, instead of Constructor ?" Watch "Axis2 - could axis instantiate a Service through Factory, instead of Constructor ?" New topic
Author

Axis2 - could axis instantiate a Service through Factory, instead of Constructor ?

Sol Mayer-Orn
Ranch Hand

Joined: Nov 13, 2002
Posts: 311
Hi,

I'm trying out the new Axis2, and was wondering:
Is there a way to ask axis2 to instantiate my Service class through a factory, rather than a constructor ?

I mean, usually the "services.xml" is something like:
- < service >
- < parameter name="ServiceClass" locked="false" > package.MyService
So the axis2 servlet instantiates the service by calling "new MyService()".

Unfortunately, my service has a private constructor (for a good reason), and can only be instantiated through
- MyFactory.createInstance()
So I'm looking for is something in the lines of :
- < parameter name="ServiceFactory" > package.MyFactory

Is there an easy way to achieve this ?

Thanks
 
 
subject: Axis2 - could axis instantiate a Service through Factory, instead of Constructor ?