Package org.jboss.fresh.registry

Examples of org.jboss.fresh.registry.RegistryContext


      if(ti == null) {
        if(i==0) {
          c = (Context) ctx.get("AppContext");
          if(c == null) {
            try {
              c = (Context) new RegistryContext().lookup("java:/FRESH/GlobalContext");
            } catch(Exception ex) {}
            i++;
          }
        } else if(i==1) {

          try {
            c = (Context) new RegistryContext().lookup("java:/FRESH/GlobalContext");
          } catch(Exception ex) {}
          if (c == null) {
            i++;
          }
        }
View Full Code Here


        if (info == null) throw new IOException("The specified file does not exist: " + filename);

        String device = (String) info.getAttributes().get("file-handler");
        if(device != null) {
          try {
            RegistryContext ctx = new RegistryContext();
            VFSFileHandlerFactory f = (VFSFileHandlerFactory) ctx.lookup(device);
            delegate = f.getInputStream(info);
          } catch(IOException ex) {
            throw ex;
          } catch(Exception ex) {
            IOException exout = new IOException("File handler initialization failed: ");
View Full Code Here

  private static Logger log = Logger.getLogger(MemVFSMeta.class);

  public MemVFSMeta(String sfJndiName, String fsname) throws Exception {
    this.sfJndiName = sfJndiName;
    fsroot = new RegistryContext(fsname);

    FileInfo inf = new FileInfo(new FileName("/"));
    inf.setCreateDate(new Date());
    inf.setFileType(FileInfo.TYPE_DIR);
    inf.setLastModified(inf.getCreateDate());
View Full Code Here

  private static Logger log = Logger.getLogger("org.jboss.fresh.vfs.impl.mem.MemVFSStore");

  public MemVFSStore(VFSMeta meta, String fsname) throws Exception {
    this.meta = meta;
    fsroot = new RegistryContext(fsname);
  }
View Full Code Here

                BufferObjectReader oin = new BufferObjectReader(getStdIn());
                if(!oin.isFinished()) {
                    o = oin.readObject();
                }
            } else if("JNDI2Registry".equals(spiObjectFactory)) {
                o = new RegistryContext().lookup((String) spiParams.get(1));
                factoryCName = org.jboss.fresh.registry.JNDI2RegistryResolverFactory.class.getName();
            } else if("StaticStore".equals(spiObjectFactory)) {
                factoryCName = org.jboss.fresh.naming.StaticObjectStore.class.getName();
            }
View Full Code Here


    public VFS getVFS() {
        VFS vfs = null;
        try {
            RegistryContext ctx = new RegistryContext();
            vfs = (VFS) ctx.lookup(vfsName);
        } catch (NamingException ex) {
            log.error(ex.getMessage(), ex);
            throw new RuntimeException("org.jboss.fresh.shell.impl.SystemShellImpl: startSession: " + vfsName + " not bound.");
        }
View Full Code Here

      return;
    }

    RootVFS rootfs = null;

    RegistryContext ctx = new RegistryContext();
    try {
      rootfs = (RootVFS) ctx.lookup("java:/CP2/VFS");
    } catch(ClassCastException ex) {
      error("VFS bound at java:/CP2/VFS is not RootVFS");
      return;
    } catch(NameNotFoundException ex) {
      error("Root VFS not bound (should be at: java:/CP2/VFS)");
      return;     
    }

    if(params.length == 0) {
      Iterator it = rootfs.listMounts().entrySet().iterator();
      while(it.hasNext()) {
        Map.Entry ent = (Map.Entry) it.next();       
        out.println(ent.getKey() + "\t\t" + ent.getValue());
      }
   
      out.flush();
      return;
    }
   

    String path = params[0];
    String jndi = params[1];
    VFS vfs = null;

    try {
      vfs = (VFS) ctx.lookup(jndi);
    } catch(NameNotFoundException ex) {
      error("No VFS bound at: " + jndi);
      return;
    }
View Full Code Here

            log.error("Could not close " + ctx + '!', e);
          }
        }
      }
      try {
        sysshell = (SystemShell) new RegistryContext().lookup(sslookup);
//      } catch(NameNotFoundException ex) {
//        ex.printStackTrace();
//        throw new RuntimeException(ex.getMessage());
      } catch (NamingException ex) {
        log.error("Error while reiniting shell!", ex);
View Full Code Here

      out.close();
      log.debug("done");
      return;
    }

    RegistryContext ctx = new RegistryContext();


    if (g) {
      BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
      Object o = null;

      try {
        o = ctx.lookup(name);
      } catch (NamingException ex) {
        if (tex)
          throw new RuntimeException(ex);
        else
          out.print("Name not bound: " + name);
        return;
      }

      oout.writeObject(o);
      oout.close();
      return;
    }

    if (l) {
      BufferObjectWriter oout = new BufferObjectWriter(getStdOut());
      Object o = ctx.lookup(name);
      if (!(o instanceof Context)) {
        if (tex)
          throw new RuntimeException("Object is not instance of Context. Can't list it. : " + name);
        else
          out.print("Object is not instance of Context. Can't list it. : " + name);
        return;
      }

      NamingEnumeration it = ctx.listBindings(name);
      while (it.hasMore()) {
        Binding bing = (Binding) it.next();
        out.println(bing.toString());
      }
      out.close();
View Full Code Here

TOP

Related Classes of org.jboss.fresh.registry.RegistryContext

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.