Examples of Zone


Examples of anvil.server.Zone

  }


  public Zone getZone()
  {
    Zone zone = _zone;
    if (zone == null) {
      return _zone = _module.getAddress().getZone();
    } else {
      return zone;
    }
View Full Code Here

Examples of anvil.server.Zone

    boolean failed = false;
    Iterator iter = script.getDependencies();
   
    Address source = envelope.getAddress();
    String sourcepath = source.getPathinfo();
    Zone zone = source.getZone();
    boolean hasPolicy = zone.getDomain().hasPolicy();
   
    while(iter.hasNext()) {
      Dependency dep = (Dependency)iter.next();
      try {
     
        Address target = dep.getAddress();
        if (hasPolicy) {
          String targetpath = target.getPathinfo();
          if (!ImportPermission.onSameDir(sourcepath, targetpath)) {
            if (!zone.checkPermission(new ImportPermission(targetpath))) {
              error(dep.getLocation(), "Access denied: "+targetpath);
            }
          }
        }
       
View Full Code Here

Examples of anvil.server.Zone

  public ByteCompiler(Smith smith, ModuleEnvelope envelope)
  {
    _smith = smith;
    _envelope = envelope;
    Zone zone = envelope.getAddress().getZone();
    _prefs = zone.getCompilerPreferences();
    _debug = zone.getDebug();
  }
View Full Code Here

Examples of anvil.server.Zone

      LoggingPreferences logprefs = new LoggingPreferences(server);
      logprefs.setLevel(severity);
      server.configure(logprefs);
      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++]));
View Full Code Here

Examples of anvil.server.Zone

      pathinfo = pathinfo.substring(1);
    } else if (!pathinfo.startsWith("/")) {
      pathinfo = "/" + pathinfo;
    }
    try {
      Zone zone = _server.resolveZone(pathinfo);
      Address address = zone.resolve(pathinfo);
      ModuleEnvelope envelope = _server.getCache().load(address);
      System.out.println("generated: "+envelope.getClassname());
    } catch (ForgingException e) {
      errors(System.err, e);
    } catch (Exception e) {
View Full Code Here

Examples of anvil.server.Zone

  }
 

  protected Type lookupLibrary(ErrorListener context)
  {
    Zone zone = _script.getAddress().getZone();
    Modules modules = zone.getModules();
    Type type = modules.lookupDeclaration(_name.get(_index-1));
    if (type != null) {
      return type;
    }

    StringBuffer libname = new StringBuffer(32);
    int i = _index;
    int length = _name.size();
    int foundIndex = -1;
    Scope foundScope = null;
    libname.append(_name.get(i-1));
    while(i <= length) {
      String name = libname.toString();
      Scope scope = zone.findJava(name);
      if (scope != null) {
        foundIndex = i;
        foundScope = scope;
      }
      if (i >= length) {
View Full Code Here

Examples of anvil.server.Zone

  /// @throws AccessDenied if security policy denies this operation
  public Any m_restart(Context context)
  {
    context.checkAccess(CAN_WRITE);
    if (_conf instanceof Zone) {
      Zone zone = (Zone)_conf;
      zone.stop();
      zone.start();
      return TRUE;
    } else {
      return FALSE;
    }
  }
View Full Code Here

Examples of anvil.server.Zone

 
  private void redirectLogin(Context context) {
    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 {
View Full Code Here

Examples of anvil.server.Zone

  /// @throws AccessDenied If security policy denies this operation
  public static final Object[] p_getRealm = { null, "*name", null };
  public Any m_getRealm(Context context, String name)
  {
    context.checkAccess(AnyRealm.CAN_READ);
    Zone zone = _context.getZone();
    if (name == null) {
      AccessPreferences access = zone.getAccessPreferences();
      if (access != null) {
        name = access.getRealm();
      }
    }
    if (name == null) {
      return UNDEFINED;
    }
    context.checkRealm(name);
    Realm realm = zone.getRealm(name);
    if (realm != null) {
      return new AnyRealm(realm);
    }
    return UNDEFINED;
  }
View Full Code Here

Examples of anvil.server.Zone

  /// @throws AccessDenied If security policy denies this operation
  public static final Object[] p_getCitizen = { null, "name", "*credentials", null };
  public Any m_getCitizen(Context context, String name, String credentials)
  {
    context.checkAccess(AnyCitizen.CAN_READ);
    Zone zone = _context.getZone();
    AccessPreferences access = zone.getAccessPreferences();
    if (access != null) {
      String realmName = access.getRealm();
      context.checkRealm(realmName);
      Realm realm = zone.getRealm(realmName);
      if (realm != null) {
        Citizen citizen = realm.getCitizen(name);
        if (citizen != null) {
          if (credentials != null) {     
            if (citizen.verifyCredentials(credentials)) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.