Package edu.chl.jadetalk.admin.view

Source Code of edu.chl.jadetalk.admin.view.ServerInfoSupportBean

package edu.chl.jadetalk.admin.view;

import com.ocpsoft.pretty.time.PrettyTime;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import edu.chl.jadetalk.admin.util.ServerInfoUtilityBean;
import java.text.SimpleDateFormat;
import javax.faces.bean.ManagedProperty;

/**
*
* @author jesper
*/
@ManagedBean
@RequestScoped
public class ServerInfoSupportBean {

    @ManagedProperty(value="#{serverInfoUtilityBean}")     
    ServerInfoUtilityBean utilBean;

    public ServerInfoUtilityBean getUtilBean() {
        return utilBean;
    }

    public void setUtilBean(ServerInfoUtilityBean utilBean) {
        this.utilBean = utilBean;
    }
   
    /** Creates a new instance of ServerInfoSupportBean */
    public ServerInfoSupportBean() {
    }
   
    public String getServerStartTime(){
        PrettyTime ptime = new PrettyTime();
        return ptime.format(utilBean.getServerStartTime());
       
    }
   
    public String getServerLocalTime(){
        return new SimpleDateFormat("hh:mm:ss").format(utilBean.getServerTime());
    }
   
}
TOP

Related Classes of edu.chl.jadetalk.admin.view.ServerInfoSupportBean

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.