Greetings all,
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]
Re: Greetings all,
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]
RE: Greetings all,
take a look at getThreadPool from ConfigurationContext http://ws.apache.org/axis2/1_1/api/org/apache/axis2/context/ConfigurationContext.html#getThreadPool() ? Martin __ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. Date: Thu, 11 Sep 2008 13:03:43 -0400 From: [EMAIL PROTECTED] To: axis-user@ws.apache.org Subject: Re: Greetings all, 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] _ Get more out of the Web. Learn 10 hidden secrets of Windows Live. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008