Package anvil

Examples of anvil.Product


  public Product resolveProduct(String filename) throws Throwable
  {
    Zone zone = resolveZone(filename);
    Address address = zone.resolve(filename);
    Module script = getCache().load(address).getModule();
    return new Product(address, System.out, script);
 
View Full Code Here



  public void service(String filename, Any[] args)
  {
    try {
      Product product = resolveProduct(filename);
      if (args == null) {
        args = new Any[0];
      }
      product.forge("main", new anvil.core.AnyList(args));
    } catch (Throwable t) {
      t.printStackTrace();
    }
  }
View Full Code Here

      server.start();

      Zone zone = server.resolveZone(filename);
      Address address = zone.resolve(filename);
      Module script = server.getCache().load(address).getModule();
      Product product = new Product(address, System.out, script);
      Array arguments = new Array();
      while(index < length) {
        arguments.append(new AnyString(args[index++]));
      }
      product.forge("main", arguments);
      System.exit(0);

    } catch (Exception e) {
      errors(System.err, e);
      System.exit(1);
View Full Code Here

      }

      anvil.core.net.AnyContext anyContext = new anvil.core.net.AnyContext(context);
      context.getResponse().setHeader("Cache-Control", "no-cache");
      Module script = zone.getServer().getCache().load(context.getAddress()).getModule();
      Product product = new Product(
        context.getAddress(), scriptOutput, context.getCitizen(), script);
      try {
        product.forge("service", anyContext);
      } finally {
        product.destroy();
        product = null;
      }

      if (printPretty) {
        ByteArrayOutputStream byteStream =(ByteArrayOutputStream)scriptOutput;
View Full Code Here

    try {
      AnyContext anyContext = new AnyContext(context);
      context.getResponse().setHeader("Cache-Control", "no-cache");
      Zone zone = context.getZone();
      Module script = zone.getServer().getCache().load(zone.resolve(loginPath)).getModule();
      Product product = new Product(
        context.getAddress(), context.getOutputStream(), context.getCitizen(), script);
      try {
        product.forge("service", anyContext);
      } finally {
        product.destroy();
        product = null;
      }
    } catch(Exception e) {
      context.log().error("Error while redirecting: "+e);
    }
View Full Code Here

TOP

Related Classes of anvil.Product

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.