|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.rssowl.controller.thread.StartupManager
public class StartupManager
Only allow one instance of RSSOwl running at the same time.
The StartupManager is a small server that is using Sockets to listen on a port. Whenever an instance of RSSOwl is starting, the server is started. In case another instance is already running the server, a message is passed to it. The server will then restore the running RSSOwl from taskbar or tray.
| Field Summary | |
|---|---|
(package private) static java.net.ServerSocket |
applLockSocket
|
private static java.lang.String |
DEFAULT_MESSAGE
|
private static java.lang.String |
LOCALHOST
|
private static int |
RSSOWL_SOCKET_PORT
|
private static ExtendedThread |
server
|
| Constructor Summary | |
|---|---|
StartupManager()
|
|
| Method Summary | |
|---|---|
private static void |
handleSocketBound(java.lang.String message)
Server already running. |
private static void |
handleSocketUnBound()
Server not yet running. |
static boolean |
isRSSOwlRunning(java.lang.String message)
Check wether RSSOwl is already running by trying to start the Server. |
private static void |
listen()
Listen for incoming messages. |
static void |
stopServer()
Stop the Server. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.lang.String LOCALHOST
private static final int RSSOWL_SOCKET_PORT
private static ExtendedThread server
private static final java.lang.String DEFAULT_MESSAGE
static java.net.ServerSocket applLockSocket
| Constructor Detail |
|---|
public StartupManager()
| Method Detail |
|---|
public static boolean isRSSOwlRunning(java.lang.String message)
message - A message passed in from the starting application.
public static void stopServer()
private static void handleSocketBound(java.lang.String message)
message - A message passed in from the starting application.private static void handleSocketUnBound()
private static void listen()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||