Update of /cvsroot/tbase/tbase-runtime/src/org/tbase/util
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21589/src/org/tbase/util
Added Files:
TBaseServiceContainer.java
Log Message:
Partial Service/SQL implementation
--- NEW FILE: TBaseServiceContainer.java ---
/*
* TBase Runtime
* Copyright (C) 2006 Ron Bakker
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* E-Mail the project team at: tba...@li...
*
*/
package org.tbase.util;
import javax.servlet.*;
import java.util.*;
/**
* @author Ron Bakker
* @version $Id: TBaseServiceContainer.java,v 1.1 2006/03/27 06:07:34 ron_bakker Exp $
*/
public class TBaseServiceContainer extends Thread
{
ServletContext m_ctx = null;
boolean m_running = false;
Hashtable<String, Object> m_services = new Hashtable<String, Object>();
public TBaseServiceContainer (ServletContext ctx)
{
m_ctx = ctx;
start();
}
public boolean isRunning()
{
return m_running;
}
protected void onIdle (long milliseconds)
{
try
{
sleep(milliseconds);
}
catch(Exception e)
{
}
}
public void run()
{
m_running = true;
while (m_running)
{
// check configuration/registry
// stop/start new services
onIdle(1000);
}
}
}
|