Update of /cvsroot/tn5250j/tn5250j/src/org/tn5250j/interfaces
In directory sc8-pr-cvs1:/tmp/cvs-serv19951/src/org/tn5250j/interfaces
Added Files:
OptionAccessFactory.java
Log Message:
Update related to enable/disable features in tn5250j
--- NEW FILE: OptionAccessFactory.java ---
/*
* @(#)OptionAccessFactory.java
* @author Kenneth J. Pouncey
*
* Copyright: Copyright (c) 2001, 2002, 2003
*
* 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, 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 software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA
*
*/
package org.tn5250j.interfaces;
import java.util.Vector;
/**
* An interface defining objects that can create OptionAccess
* instances.
*/
public abstract class OptionAccessFactory {
private static OptionAccessFactory factory;
/**
* @return An instance of the OptionAccess.
*/
public static OptionAccessFactory getInstance()
{
OptionAccessFactory.setFactory();
return factory;
}
private static final void setFactory()
{
if (factory == null)
{
try
{
String className = System.getProperty(OptionAccessFactory.class.getName());
if (className != null)
{
Class classObject = Class.forName(className);
Object object = classObject.newInstance();
if (object instanceof OptionAccessFactory)
{
OptionAccessFactory.factory = (OptionAccessFactory) object;
}
}
}
catch (Exception ex)
{
;
}
if (OptionAccessFactory.factory == null)
{ //take the default
OptionAccessFactory.factory = new org.tn5250j.OptionAccess();
}
}
}
abstract public Vector getOptions();
abstract public Vector getOptionDescriptions();
abstract public boolean isValidOption(String option);
abstract public boolean isRestrictedOption(String option);
abstract public int getNumberOfRestrictedOptions();
abstract public void reload();
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.