Interface TableProvider
public interface TableProvider
Implement this interface to add a custom TableProvider to LiveView.
In an LVConf, reference your implementation as the example below, assuming your class that implements
TableProvider is com.MyCompany.MyTableProvider.
- Since:
- LiveView 1.6
-
Method Summary
Modifier and TypeMethodDescriptionvoid
initialize
(String id, TableProviderControl helper, TableProviderParameters parameters, TableNameMapper mapper) An instance of your class will be initialized with the parameters that were defined in the LVConf.void
shutdown()
When this is called, you should close threads and do whatever else is necessary to clean up.void
start()
You should connect to your server successfully before returning from this call.
-
Method Details
-
initialize
void initialize(String id, TableProviderControl helper, TableProviderParameters parameters, TableNameMapper mapper) throws LiveViewException An instance of your class will be initialized with the parameters that were defined in the LVConf.- Parameters:
id
- The id by which this TableProvider is declaredhelper
- Used to control the life cycle of the tableparameters
- Allows parameters supplied in LVCONFs to be passed to the table implementationmapper
- Provides a means to translate tables names based on LVCONF configuration- Throws:
LiveViewException
-
start
You should connect to your server successfully before returning from this call. Once you return, the failedAttemptsCount associated with your TableProvider will be cleared, so don't return until you feel that some measure of success was achieved. Note that a new thread is created for the call to this method, so if you need to poll your server, you can simply not return from this method. However, if this is the case, then you should call the clearRetryCount() method of the TableProviderControl once you have successfullly connected. If you are unable to connect with your back end, or if you lose the connection in a polling situation, throw a LiveViewException out of this method. If you are polling the back end, you will get an interrupt from your Thread.sleep() if your TableProvider is being closed. You can just let it throw out of the method or you can catch it, clean up, and rethrow it. -
shutdown
void shutdown()When this is called, you should close threads and do whatever else is necessary to clean up. This means either that your provider was shut down via a service call, or else LiveView itself is shutting down.
-