/**
* This file is part of Faktotum.
*
*
* Faktotum is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or (at your option) any later version.
*
* Faktotum is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Faktotum.
*
* If not, see <http://www.gnu.org/licenses/>.
*/
package de.romankreisel.faktotum.handlers;
import java.util.Date;
import javax.ejb.EJB;
import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;
import de.romankreisel.faktotum.beans.FaktotumProductBean;
/**
* @author Roman Kreisel <mail@romankreisel.de>
*
* This Handler provides information about the Faktotum product and the
* environment it's running on
*/
@ManagedBean
@ApplicationScoped
public class FaktotumProductHandler extends FaktotumHandler {
/**
*
*/
private static final long serialVersionUID = 7380050708648987527L;
@EJB
FaktotumProductBean faktotumBean;
/**
* @return the build date
*/
public Date getBuildDate() {
return this.faktotumBean.getBuildDate();
}
/**
* @return the maximum memory available to the JVM
*/
public long getMaximumMemory() {
return Runtime.getRuntime().maxMemory();
}
/**
* @return the configured product name
*/
public String getProductName() {
return this.faktotumBean.getProductName();
}
/**
* @return The time this Faktotum-instance was started
*/
public Date getStartTime() {
return this.faktotumBean.getStartTime();
}
public String getSystemProperty(String propertyName) {
return System.getProperty(propertyName);
}
/**
* @return the memory used by the JVM
*/
public long getUsedMemory() {
return Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
}
/**
* @return the version number of faktotum
*/
public String getVersion() {
return this.faktotumBean.getVersion();
}
}