com.antelmann.db.remote
Class RemoteDBChangeNotifier
java.lang.Object
com.antelmann.db.remote.RemoteDBChangeNotifier
- All Implemented Interfaces:
- DatabaseChangeListener, Closeable
public class RemoteDBChangeNotifier
- extends Object
- implements DatabaseChangeListener, Closeable
used to propagate database changes to a remote server.
As the delivery is done in an asynchronous manner, this implementation uses
a ThreadWorker setup as a daemon that performs the notification.
To enable notification, simply add this as a listener to a database using a DatabaseChangeMonitor.
- Since:
- 15.11.2008, 20:11:42
- Author:
- Holger Antelmann
- See Also:
RemoteDatabaseChangeHandler,
ChangeNotificationServer
RemoteDBChangeNotifier
public RemoteDBChangeNotifier(String databaseName,
String server)
throws IOException
- Throws:
IOException
RemoteDBChangeNotifier
public RemoteDBChangeNotifier(String databaseName,
String server,
int port)
throws IOException
- Throws:
IOException
RemoteDBChangeNotifier
public RemoteDBChangeNotifier(String databaseName,
String server,
int port,
Filter<? super DBUpdateEvent> filter)
throws IOException
- Throws:
IOException
RemoteDBChangeNotifier
public RemoteDBChangeNotifier(NetConnection con,
Filter<? super DBUpdateEvent> filter)
getExecutor
public ThreadWorker getExecutor()
setExecutor
public void setExecutor(ThreadWorker executor)
getFilter
public Filter<? super DBUpdateEvent> getFilter()
setFilter
public void setFilter(Filter<? super DBUpdateEvent> filter)
- allows to set a filter, so that not every event may be propagated to the server
committedDatabaseChanges
public void committedDatabaseChanges(Database<?> db,
DBUpdateEvent... events)
- Description copied from interface:
DatabaseChangeListener
- called after successfully committing the given DBUpdateEvents on the database.
Implementations must not begin a new transaction directly!
- Specified by:
committedDatabaseChanges in interface DatabaseChangeListener
- See Also:
TransactionListener.transactionCommitted(DBTransaction),
DBVersionedUpdateEvent
close
public void close()
throws IOException
- Specified by:
close in interface Closeable
- Throws:
IOException
finalize
protected void finalize()
throws Throwable
- Overrides:
finalize in class Object
- Throws:
Throwable
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads