Search in sources :

Example 1 with DefaultPollerResponse

use of com.liferay.portal.kernel.poller.DefaultPollerResponse in project liferay-blade-samples by liferay.

the class BladePollProcessor method doReceive.

@Override
protected PollerResponse doReceive(PollerRequest pollerRequest) throws Exception {
    _log.log(LogService.LOG_INFO, "Recevied the poller request" + pollerRequest);
    JSONObject responseObject = JSONFactoryUtil.createJSONObject();
    PollerResponse pollerResponse = new DefaultPollerResponse();
    responseObject.put("message", "Hello from BLADE Poller, time now is:" + new Date());
    pollerResponse.setParameter("content", responseObject);
    return pollerResponse;
}
Also used : DefaultPollerResponse(com.liferay.portal.kernel.poller.DefaultPollerResponse) JSONObject(com.liferay.portal.kernel.json.JSONObject) DefaultPollerResponse(com.liferay.portal.kernel.poller.DefaultPollerResponse) PollerResponse(com.liferay.portal.kernel.poller.PollerResponse) Date(java.util.Date)

Aggregations

JSONObject (com.liferay.portal.kernel.json.JSONObject)1 DefaultPollerResponse (com.liferay.portal.kernel.poller.DefaultPollerResponse)1 PollerResponse (com.liferay.portal.kernel.poller.PollerResponse)1 Date (java.util.Date)1