Hmm , I do not think I completely understand your problem. Any way in
Axis2 if you want to start a thread for your service . Then the right
way is to have a implement ServiecLifeCycle interface and inside that
write the thread starting code. And then store pointer to that thread
inside AxisService and use that whenever you need. Information about
adding service lifecycle class can be found in the following article.

http://wso2.org/library/2060

Thank you!
Deepal

David Pizon wrote:
> Greetings all,
>
> First of all my hat is off to the AXIS group. This is a fantastic tool.
>
> My class works perfect as a web service until I try to instantiate a threaded 
> class. Is there a particular way to do this within Axis?
>
> My "DocumentService" class (and internal thread) works perfectly when run as 
> an application.
>
>
> <code>
> import java.util.*;
>
> import com.custom.classes.*;
>
> /**
>  * Class to interact as a web service
>  */
> public class DocumentService {
>       // Custom classes
>       private DocumentBroker m_broker;
>       private DocumentAssemblyCreater m_assemblyCreater;
>       
>       /**
>        * Initialize this object
>        */
>       public DocumentumService() throws Exception {
>               this.m_broker = new com.custom.classes.DocumentBroker();
>               this.m_assemblyCreater = new DocumentAssemblyCreater();
>
>               // Spin the assembly creater as a separate thread
>               this.m_assemblyCreater.start();
>       }
>       
>       /**
>        * Create an assembly object from a virtual document
>       *  We will get back a process token (assembling takes some time to run)
>       */
>       public String getProcessToken(String username, String password, String 
> documentBase, String publicationId) throws Exception {
>               // Let the DocumentAssemblyCreater handle creating the assembly
>               return this.m_assemblyCreater.getProcessToken(username, 
> password, documentBase, publicationId);
>       }
>
>       /**
>        * Get the completed document
>       * Pass in the token. Get the publication as a string or null if it has 
> not processed yet.
>       */
>       public String getDocument(String processToken) throws Exception {
>               // Let the DocumentAssemblyCreater handle creating the assembly
>               return this.m_assemblyCreater.getDocument(processToken);
>       }
> }
> </code>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to