|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.db.remote.ChangeNotificationServer
public class ChangeNotificationServer
implements a server for a change notification mechanism.
It is recommended to use the same connection instance for both,
RemoteDBChangeNotifier and RemoteDatabaseChangeHandler,
as this implementation automatically prevents to propagate changes to the same connection.
This implementation also allows filtering based on RemoteDBChangeFilter, which can
be set from the client through the connection.
ChangeNotificationClient,
RemoteDBUpdateEvent,
RemoteDBChangeFilter| Field Summary | |
|---|---|
static int |
PORT
|
| Constructor Summary | |
|---|---|
ChangeNotificationServer(String databaseName,
int port,
Logger logger)
|
|
ChangeNotificationServer(String databaseName,
Logger logger)
|
|
| Method Summary | |
|---|---|
void |
connectionLost(NetConnection connection)
called when a connection caused an IOException during reading or writing; the connection may not have been closed at this point. |
static Handshake |
createHandshake(String databaseName)
|
String |
getDatabaseName()
provides the name for this notification server; connecting clients must use the same name |
NetConnectionServer |
getServer()
provides access to the server to start/stop it |
void |
handleMessage(Object message,
NetConnection connection)
called when a message is received by the given NetConnection object |
boolean |
isDeliverToSelf()
|
void |
setDeliverToSelf(boolean deliverToSelf)
only if set to true, database changes are also delivered to the connection the message came from (the default is false) |
static void |
startGUIServer(String databaseName)
|
static void |
startGUIServer(String databaseName,
int port)
starts a demo change notification server that utilizes a JTextComponentLog |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PORT
| Constructor Detail |
|---|
public ChangeNotificationServer(String databaseName,
Logger logger)
throws IOException
IOException
public ChangeNotificationServer(String databaseName,
int port,
Logger logger)
throws IOException
IOException| Method Detail |
|---|
public static Handshake createHandshake(String databaseName)
public boolean isDeliverToSelf()
public void setDeliverToSelf(boolean deliverToSelf)
public String getDatabaseName()
public NetConnectionServer getServer()
public void handleMessage(Object message,
NetConnection connection)
NetConnectionHandler
handleMessage in interface NetConnectionHandlerpublic void connectionLost(NetConnection connection)
NetConnectionHandler
connectionLost in interface NetConnectionHandler
public static void startGUIServer(String databaseName)
throws IOException
IOException
public static void startGUIServer(String databaseName,
int port)
throws IOException
JTextComponentLog
databaseName - the name of the database that clients use to connect to this serverport - the local server port to be used
IOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||