Package pt.opensoft.resource

Examples of pt.opensoft.resource.Resource


          if (value == null) continue;
          resourceConfigParams.setValue(name, value);
        }

        Class newClass = Class.forName(type);
        Resource res = (Resource) newClass.newInstance();
        res.setId(resourceName);
        res.config(resourceConfigParams);
        try {
          res.start();
        } catch (ResourceException e) {
          logger.error("Resource " + resourceName + " unable to Start:", e);
        }

        resources.put(resourceName, res);
View Full Code Here


        String tableName = args[0];
        String fileName = args[1];

        Logger.getDefault().setLevel(Level.DEBUG);
        ResourceManager.init(Logger.getDefault());
        Resource resource = ResourceManager.get(DB_RESOURCE_NAME, DB_RESOURCE_TIMEOUT);

        try {
            DBConnect dbc = ((JDBCResource) resource).getDBConnect();

            FileWriter writer = new FileWriter(fileName);
View Full Code Here

    protected void execute(Resource r1, Resource r2) throws Exception {
      throw new UnsupportedOperationException("Invoke execute with triple resource ");
    }
   
    protected void execute(Resource r1) throws Exception {
        Resource r2 = getResource(r2Name, r2Timeout);
        Resource r3 = getResource(r3Name, r3Timeout);
        try {
            execute(r1, r2, r3);
        } finally {
            releaseResource(r2Name, r2);
            releaseResource(r3Name, r3);
View Full Code Here

        setResourceName(resourceName);
        setResourceTimeout(timeout);
    }

    protected Resource getResource(String name, long timeout) throws Exception {
        Resource resource = ResourceManager.get(name, timeout);
        logger.push(resource.getId());
        return resource;
    }
View Full Code Here

    setResourceName(resourceName);
    setResourceTimeout(timeout);
  }

  protected Resource getResource(String name, long timeout) throws Exception {
    Resource resource = ResourceManager.get(name, timeout);
    logger.push(resource.getId());
    return resource;
  }
View Full Code Here

TOP

Related Classes of pt.opensoft.resource.Resource

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.