Package pt.opensoft.field

Examples of pt.opensoft.field.Record


  private Map createResource (String[] resourcesNames, IBatchProcessor ibProcessor) throws IOException {

    Map resources = new HashMap();
    String type = null;
    Parameters parameters = ibProcessor.getProcessosParameters();
    Record resourceConfigParams = new Record();
    String resourceName;
    StringBuffer resourceFullName = new StringBuffer();

    try {
      for (int i = 0; i < resourcesNames.length; i++) {
        resourceName = resourcesNames[i];
        resourceFullName.append("resource.").append(resourceName).append(".");

        type = parameters.getString(resourceFullName + "type");
        Logger _logger = Logger.getDefault().getWrapper();

        resourceConfigParams.setValue("loggerInstance", _logger);

        Vector properties = parameters.getVector(resourceFullName + "properties");
        for (int j = 0; j < properties.size(); j++) {
          String name = (String) properties.get(j);
          String value = parameters.getString(resourceFullName + name);
          if (value == null) continue;
          resourceConfigParams.setValue(name, value);
        }

        Class newClass = Class.forName(type);
        Resource res = (Resource) newClass.newInstance();
        res.setId(resourceName);
View Full Code Here


    return _id;
  }

  public void config (Object ob) {
    //Configurar os par�metros necess�rios para alocar a resource
    Record nv = (Record) ob;

    _driver = nv.getString("driver");
    setUrl(nv.getString("url", "jdbc:odbc:" + nv.getValue("dsn")));
    setUser(nv.getString("username", nv.getString("user", nv.getString("usr"))));
    setPassword(nv.getString("password", nv.getString("psw", nv.getString("pwd"))));
    setDebug(nv.getString("debug"));
    setThreshold(nv.getString("threshold"));
    setMaxUsage(nv.getString("maxUsage"));
    setMaxRetries(nv.getString("maxRetries"));
    setRetryTime(nv.getString("retryTime"));
    setQueryTimeout(nv.getString("queryTimeout"));
    setMaxIdleTime(nv.getString("maxIdleTime"));
    setOptimizeRollbackCalls(nv.getString("optimizeRollbackCalls"));
        _initSql = nv.getString("initSql");

    _logger = (Logger) nv.getValue("loggerInstance", Logger.getDefault());
  }
View Full Code Here

public class FileResource extends SimpleResource implements Resource {
  protected String spec = null;

  public void config(Object ob) {
    Record nv = (Record) ob;
    spec = nv.getString("path");
  }
View Full Code Here

        throw new RuntimeException("Deprecated!!!");
    }

    public void init(Parameters parameters) throws IOException {

        _resourceConfigParams = new Record();
        String resourceId = "resource." + _resourceDispenserId;
        _resourceConfigParams.setValue("loggerInstance", _logger);

        Vector properties = parameters.getVector(resourceId + ".properties");
        for (int i = 0; i < properties.size(); i++) {
View Full Code Here

  */

  public void config (Object ob) {
    super.config(ob);

    Record nv = (Record)ob;
    _dbWaitSeconds = nv.getInt("dbWaitSeconds", _dbWaitSeconds);

  }
View Full Code Here

    public DataSourceResource(DataSource dataSource, Object params) throws SQLException, ResourceException {
        config(params);
        setId("#" + Math.abs(RandomUtil.randomInt()));
        Connection connection = dataSource.getConnection();

        Record nv = (Record) params;
        logRelease = nv.getBooleanValue("log.release", false);

      try {
        _dbc = new DBConnect(connection);
        _dbc = configDBConnect(_dbc);
View Full Code Here

   
  }

  public void config(Object ob) {
   
    Record nv = (Record)ob;
    String debug;
   
    if ( (debug = (String) nv.getValue("debug")) != null) {
      if (debug.equalsIgnoreCase("true")) {
          this.debug = true;
      }       
    }   
  }
View Full Code Here

    setResponseTimeout(DEFAULT_TIMEOUT); // for http connection
    setStreaming(false); // for http connection
  }

  public void config(Object ob) {
    Record nv = (Record) ob;
    setEncoding(nv.getString("encoding", HttpConnectionWraper.DEFAULT_ENCODING));
    setUrl(nv.getString("url", null));
    setDebug(nv.getBooleanValue("debug", false));
    setThreshold(nv.getLongValue("threshold", DEFAULT_THRESHOLD));
    setTimeout(nv.getLongValue("timeout", DEFAULT_TIMEOUT)); // for http connection
    setConnectionType(nv.getString("connectionType", HttpConnectionWraper.DEFAULT_HTTP_CONNECTION));
    setResponseTimeout(nv.getString("responseTimeout", null) != null ? Integer.valueOf(nv.getString("responseTimeout")).intValue()
        : (int) super.timeout); // for http connection
    setStreaming(nv.getBooleanValue("streaming", false));
  }
View Full Code Here

//  protected static int count = 0;

  protected String spec = null;

  public void config(Object ob) {
    Record nv = (Record) ob;
    spec = nv.getString("url");
    setThreshold(nv.getLongValue("threshold", DEFAULT_THRESHOLD));
    setTimeout(nv.getLongValue("timeout", DEFAULT_TIMEOUT));
  }
View Full Code Here

      // dealocar o recurso f�sico
  }

  public void config(Object ob) {
    //Configurar os par�metros est�ticos necess�rios para alocar a resource
    Record nv = (Record)ob;

    _sleep = nv.getLongValue("sleep", _sleep);
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.field.Record

Copyright © 2018 www.massapicom. 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.