org.brutusin.demo.spring.GetDateAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rpc-examples Show documentation
Show all versions of rpc-examples Show documentation
Examples of Brutusin-RPC component implementations
package org.brutusin.demo.spring;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.brutusin.rpc.http.Cacheable;
import org.brutusin.rpc.http.SafeAction;
public class GetDateAction extends SafeAction {
private SimpleDateFormat dateFormat = new SimpleDateFormat();
@Override
public Cacheable execute(Void input) throws Exception {
return Cacheable.never(dateFormat.format(new Date()));
}
public void setDatePattern(String pattern) {
dateFormat = new SimpleDateFormat(pattern);
}
}