> What type is "thread" (in "thread.start") ? And what exactly is
> ListenerThread ?
> i think you are speaking of different apis. Nothing about osgi (like Karl
> just said).
I have used both a Thread and a Runnable:
public class ListenerThread extends Thread // or public class ListenerThread
implements Runnable
{
public ListenerThread(int port) throws Exception
{
serverSocket = new ServerSocket(port);
}
public void run()
{
while (true)
{
Socket socket = serverSocket.accept(); // accept connection
:
(do some stuff here...)
}
}
}
The issue is that I get different behavior when I execute this code within
OSGi, and outside of OSGi (using the Java 1.6 JVM).
ListenerThread t = new ListenerThread(39000);
t.start()
Creates a new thread when running in the standard JVM, but when it runs from
within OSGi, it runs the ListenerThread code within the calling thread, and
effectively suspends the calling thread.
Larry
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]