|
From: Nick R. <nic...@em...> - 2004-06-30 17:46:23
|
Thanks for your reply Leif. I'm running the app simply as "java Pserver.class" in the console. The Pserver.java looks like: import java.io.*; import java.net.*; public class Pserver { public static void main(String[] args) { ServerSocket serverSocket; Socket client; Pthread thClient; try { serverSocket=new ServerSocket(39823); while(true) { client=serverSocket.accept(); thClient = new Pthread(client); thClient.run(); } } catch(Exception e) { e.printStackTrace(); } } } Can u please give me an example on the above code, as to how to implement the helper class and what configuration to use for the wrapper. Maybe I am thinking too hard :) Thanks for your help mate! ------------------------------------- Nick, How are you running your application without the Wrapper? If you use method 1, with the WrapperSimpleApp helper class, there is zero special coding that you will have to do. You simply specify your main class as the argument to the WrapperSimpleApp helper class and you are up and running. It sounds like your Pserver and Pthread classes are both running in the same JVM? Correct? Post how you normally run them from a console and I"ll tell you what you need to do to use the Wrapper. I have a feeling that you are just thinking too hard :-) Cheers, Leif Nick Rice wrote: >Hello All, > >This wrapper is exactly what I"ve was looking for. But I need some help >on how to go about integrating it with my application. See, I have a two >java class files (say Pserver.class and Pthread.class). Pserver listens >as a server socket (i.e. in a while loop), and it passes the socket >client to the Pthread class which processes the incoming data. Now, in >this scenario, how can I go about integrating the Pserver as an >unmanaged service. I read the docs but I"m not sure which of the three >integration methods is most suitable in my case. I tried playing with >the first (simpler) integration method but due to my limited Java >knowledge I could not get it to run as a service. I guess what I"m >missing is hot to integrate the wrapper and my Pserver class. Can >someone provide more details on how to impelment the helper class in my >Pserver class and then finally where to specify the wrapper to use the >modified Pserver. > >Any help is much appreciated. Thanks :) -- Nick Rice nic...@em... |