* distributed under the License is distributed on an AS IS BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
- * limitations under the License.
+ * limitations under the License.
*/
#include <dpl/log/log.h>
-#include <Commons/WrtWrapper/WrtWrappersMgr.h>
+#include <Commons/WrtAccess/WrtAccess.h>
#include <Commons/plugin_initializer_def.h>
#include "JSFilesystemManager.h"
#include "JSFile.h"
#include "JSFilestream.h"
+using namespace WrtDeviceApis;
using namespace WrtDeviceApis::Commons;
-void on_widget_start_callback(int widgetId,
- JavaScriptContext context,
- const engine_interface_t *interface)
+void on_widget_start_callback(int widgetId)
{
Try {
- WrtWrappersMgr::getInstance().registerWrapper(widgetId, context, interface);
- } Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Wrt wrapper registration failed");
+ WrtAccessSingleton::Instance().initialize(widgetId);
+ } Catch (Commons::Exception) {
+ LogError("WrtAccess initialization failed");
}
}
void on_widget_stop_callback(int widgetId)
{
Try {
- WrtWrappersMgr::getInstance().removeWrapper(widgetId);
- } Catch (WrtDeviceApis::Commons::Exception) {
- LogError("Wrt wrapper removal failed");
+ WrtAccessSingleton::Instance().deinitialize(widgetId);
+ } Catch (Commons::Exception) {
+ LogError("WrtAccess deinitialization failed");
}
}