<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root
	xmlns:jsp="http://java.sun.com/JSP/Page"
	xmlns:og="hybs-taglib.tld"
	version="2.0">
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8" />

<og:head headType="result" />
<jsp:directive.include file="/jsp/custom/result_info.jsp" />
<og:comment
	system	= "GF:エンジンサンプル"
	pgid	= "GF6300"
	title	= "画面リフレッシュ"
	date	= "2008/10/27"
	author	= "Hiroki.Nakamura"
	text	= ""
	version	= "001"
/>

<jsp:declaration>
	public static int count = 0;
</jsp:declaration>

<jsp:scriptlet>
	int num = Integer.parseInt( request.getParameter( "NUM" ) );
	if(  count &lt; num ) {
		count ++;
		// og:responseHeader タグで対応
//		String ref = request.getParameter( "Ref" );
//		response.setHeader( "Refresh",ref );

		request.setAttribute( "nowDate"		,String.valueOf( new java.util.Date() ) );
		request.setAttribute( "nowCount"	,String.valueOf( count + "/" + num ) );
	}

	int loginCount = org.opengion.hayabusa.common.SystemManager.getRunningCount() ;

	int freeMemory  = (int)( Runtime.getRuntime().freeMemory()/1024 ) ;
	int totalMemory = (int)( Runtime.getRuntime().totalMemory()/1024 );
	int useMemoryRatio = (int)(((totalMemory - freeMemory) * 100 )/totalMemory) ;

	request.setAttribute( "loginCount"		,String.valueOf( loginCount ) );
	request.setAttribute( "freeMemory"		,String.valueOf( freeMemory ) );
	request.setAttribute( "totalMemory"		,String.valueOf( totalMemory ) );
	request.setAttribute( "useMemoryRatio"	,String.valueOf( useMemoryRatio ) );
</jsp:scriptlet>

<og:text>
	<pre>Now Date    [ {@nowDate}  ]</pre><br />
	<pre>Now Counter [ {@nowCount} ]</pre><br />
<p />
	<table border = "0px" >
		<tr><td colspan = "4" >ログインユーザー</td></tr>
		<tr><td width="20px"  ></td><td>ログイン人数</td><td>=</td><td>{@loginCount} 名 </td></tr>
		<tr><td colspan = "4" ></td></tr>
		<tr><td colspan = "4" >メモリ情報</td></tr>
		<tr><td width="20px"  ></td><td>空きメモリ</td><td>=</td><td>{@freeMemory} [KByte]</td></tr>
		<tr><td width="20px"  ></td><td>合計メモリ</td><td>=</td><td>{@totalMemory} [KByte]</td></tr>
		<tr><td width="20px"  ></td><td>使用率    </td><td>=</td><td>{@useMemoryRatio} [％]</td></tr>
	</table>

	<table width="50%" frame="box" border = "1px" cellspacing="0px" cellpadding="0px" >
		<tr>
			<td width="{@useMemoryRatio}%" bgcolor="red" ></td>
			<td>
				<img width="100%" height="10px" src="../image/space.gif" alt="{@useMemoryRatio}%" />
			</td>
		</tr>
	</table>
</og:text>

<og:responseHeader refresh="{@Ref}" refreshURL="result.jsp?Ref={@Ref}&amp;NUM={@NUM}" />

<jsp:directive.include file="/jsp/common/htmlend.jsp" />
</jsp:root>
