Fórum
Using method without ActionRequest and ActionResponse
practicante practicante, modificado 9 Anos atrás.
Using method without ActionRequest and ActionResponse
Junior Member Postagens: 47 Data de Entrada: 19/07/13 Postagens Recentes
Hi
I have a method that receive two parameters an object of the type ActionRequest and ActionResponse
something like this
but at this point I donde have any request or any response, can I make my own response and request in the class Calendarizado?
or can I convert some data in request Object?
I have a method that receive two parameters an object of the type ActionRequest and ActionResponse
public void doSomething(ActionRequest, ActionResponse)
{
//logic
}
and works fine, but I want to excute this method in a schedule something like this
public class Calendarizado implements MessageListener{
private static final Log LOGGER = LogFactoryUtil.getLog(Calendarizado.class);
public void receive(Message arg0) throws MessageListenerException {
call doSomething(param, param);
}
}
but at this point I donde have any request or any response, can I make my own response and request in the class Calendarizado?
or can I convert some data in request Object?
Andew Jardine, modificado 9 Anos atrás.
RE: Using method without ActionRequest and ActionResponse
Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
practicante,
I think the MessageListener is the handler for the event -- or more accurately the message placed onto the bus. I think what you are probably looking to do is retrieve the "message data" from the actionRequest in your processAction method, construct a Message object and place it on the bus for it to get to the Listener. If the message contains everything the Listener needs to process, then you shouldn't need the actionRequest in the Listener class. So, something like --
I think the MessageListener is the handler for the event -- or more accurately the message placed onto the bus. I think what you are probably looking to do is retrieve the "message data" from the actionRequest in your processAction method, construct a Message object and place it on the bus for it to get to the Listener. If the message contains everything the Listener needs to process, then you shouldn't need the actionRequest in the Listener class. So, something like --
public void processAction(ActionRequest actionRequest, ActionResponse actionResponse )
{
// build your message to be sent to the listener
Message message = new Message();
message.put("key", ParamUtil.getString(actionRequest, "variable-name");
// place it on the bus
MessageBusUtil.sendSynchronousMessage( <destination>, message);
}
</destination>
Pankaj Kathiriya, modificado 9 Anos atrás.
RE: Using method without ActionRequest and ActionResponse
Liferay Master Postagens: 722 Data de Entrada: 05/08/10 Postagens Recentes
Scheduler jobs are something thats runs offline(without any browser request which leads request-response life cycle) as per interval defined without any request-response cycle. You cant define or make use of actionRequest or actionResponse in scheduler method.