Package anvil.script

Examples of anvil.script.Context


   * @param script Module
   */
  public Product(Address address, OutputStream output, Citizen citizen, Module script)
  {
    _script = script;
    _context = new Context(Thread.currentThread(), address.getZone(), citizen, _globals);
    _context.setOutputStream(output)
  }
View Full Code Here


   * @param script Module
   */
  public Product(Address address, OutputStream output, Module script)
  {
    _script = script;
    _context = new Context(Thread.currentThread(), address.getZone(), null, _globals);
    _context.setOutputStream(output)
  }
View Full Code Here

   * @param script Module
   */
  public Product(Address address, Module script)
  {
    _script = script;
    _context = new Context(Thread.currentThread(), address.getZone(), null, _globals);
  }
View Full Code Here

      case Types.TIME:
        {
          Time time = set.getTime(field);
          if (time != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(time);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
        }

      case Types.TIMESTAMP:
        {
          Timestamp time = set.getTimestamp(field);
          if (time != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(time);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
        }

      case Types.DATE:
        {
          Date date = set.getDate(field);
          if (date != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(date);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
View Full Code Here

      case Types.TIME:
        {
          Time time = stmt.getTime(field);
          if (time != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(time);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
        }

      case Types.TIMESTAMP:
        {
          Timestamp time = stmt.getTimestamp(field);
          if (time != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(time);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
        }

      case Types.DATE:
        {
          Date date = stmt.getDate(field);
          if (date != null) {
            Context context = Context.getInstance();
            Calendar cal = Calendar.getInstance(context.getTimeZone(), context.getLocale());
            cal.setTime(date);
            return new AnyCalendar(cal);
          } else {
            return Any.NULL;
          }
View Full Code Here

  }


  public static Any unserialize(Unserializer unserializer) throws UnserializationException
  {
    Context context = unserializer.getContext();
    unserializer.consume('s');
    String classname = unserializer.getUTF16String();
    unserializer.consume('s');
    String pathinfo = unserializer.getUTF16String();
    Scope scope = context.import_(pathinfo);
    AnyClass self = null;
    Type type = anvil.script.Grammar.follow(scope, classname);
    if (type != null) {
      if (type.getType() == Type.CLASS) {
        self = ((ClassType)type).newInstance();
View Full Code Here

    }

    public Object nextElement()
    {
      if (_index <= _size) {
        Context context = Context.getInstance();
        try {
          return SQLUtil.getField(_resultSet, getMetaData(), _index++);
        } catch (SQLException e) {
          throw Context.getInstance().exception(e);
        }
View Full Code Here

  }


  public Context getContext() throws UnserializationException
  {
    Context context = _context;
    if (context == null) {
      _context = context = Context.getInstance();
    }
    return context;
  }
View Full Code Here

  }


  public void shutdown()
  {
    Context ctx = _context;
    if (ctx != null) {
      ctx.log().info("Thread shutting down");
    }
    clear();
  }
View Full Code Here

  }

 
  public void overload()
  {
    Context ctx = _context;
    if (ctx != null) {
      ctx.log().error("Overload, cannot start thread");
    }
    clear();
  }
View Full Code Here

TOP

Related Classes of anvil.script.Context

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.