Package com.ibm.domino.xsp.module.nsf

Examples of com.ibm.domino.xsp.module.nsf.NotesContext


  public Application createApplication(Object context) {
    ApplicationEx facesApplication = ApplicationEx.getInstance();
    // Try to find the application name
    // We start from the the NotesContext, which should be defined
    String name = null;
    NotesContext ctx = NotesContext.getCurrentUnchecked();
    if(ctx!=null) {
      name = ctx.getModule().getModuleName();
    } else {
      name = facesApplication.getApplicationId();
    }
    return new XspApplication(facesApplication,(ServletContext)context,name);
  }
View Full Code Here


    this(runnable, module);
    classLoader_ = classLoader;
  }

  private void initModule() {
    NotesContext ctx = NotesContext.getCurrentUnchecked();
    if (ctx != null) {
      module_ = ctx.getRunningModule();
    } else {
      if (classLoader_ == null) {
        classLoader_ = XotsNativeRunner.class.getClassLoader();
      } else if (classLoader_ instanceof ModuleClassLoader) {
        throw new IllegalArgumentException("Can't queue a " + XotsNativeRunner.class.getName() + " without a current NotesContext.");
View Full Code Here

    ClassLoader cl = ((AbstractDominoRunnable) getRunnable()).getContextClassLoader();
    if (cl == null) {
      cl = classLoader_;
    }
    if (module_ != null) {
      NotesContext nctx = new NotesContext(module_);
      NotesContext.contextThreadLocal.set(nctx);
    }
    Session session = this.getNamedSession();
    setSession(session);
  }
View Full Code Here

    public ThreadContext(final String username, final String servername, final String dpath) {
      this.username = username;
      this.servername = servername;
      this.dbpath = dpath;
      NotesContext current = NotesContext.getCurrentUnchecked();
      if (current == null) {
        this.module = null// Ummmm... bad things are about to happen...
      } else {
        this.module = NotesContext.getCurrent().getModule();
      }
View Full Code Here

      lotus.domino.Session result = null;
      try {
        result = AccessController.doPrivileged(new PrivilegedExceptionAction<lotus.domino.Session>() {
          @Override
          public Session run() throws Exception {
            NotesContext nc = new NotesContext(mod);
            NotesContext.initThread(nc);
            long hList = com.ibm.domino.napi.c.NotesUtil.createUserNameList(username);
            return XSPNative.createXPageSession(username, hList, true, false);
          }
        });
View Full Code Here

    @Override
    public void run() {
      classes_ = new HashSet<Class<?>>();
      try {
        NotesContext ctxContext = new NotesContext(module_);
        NotesContext.initThread(ctxContext);
        ClassLoader mcl = module_.getModuleClassLoader();
        for (String className : classNames_) {
          Class<?> curClass = null;
          String[] classDefBits = className.split(";")// There may be ";boolean" at the end
View Full Code Here

    super(runnable, classLoader);
    module_ = module;
  }

  private void initModule() {
    NotesContext ctx = NotesContext.getCurrentUnchecked();
    if (ctx != null) {
      module_ = ctx.getRunningModule();
    } else {
      if (classLoader_ == null) {
        classLoader_ = XotsNativeRunner.class.getClassLoader();
      } else if (classLoader_ instanceof ModuleClassLoader) {
        throw new IllegalArgumentException("Can't queue a " + XotsNativeRunner.class.getName() + " without a current NotesContext.");
View Full Code Here

    ClassLoader cl = ((AbstractDominoRunnable) getRunnable()).getContextClassLoader();
    if (cl == null) {
      cl = classLoader_;
    }
    if (module_ != null) {
      NotesContext nctx = new NotesContext(module_);
      NotesContext.contextThreadLocal.set(nctx);
    }
    super.preRun();
  }
View Full Code Here

    super(runnable, classLoader);
    module_ = module;
  }

  private void initModule() {
    NotesContext ctx = NotesContext.getCurrentUnchecked();
    if (ctx != null) {
      module_ = ctx.getRunningModule();
    } else {
      if (classLoader_ == null) {
        classLoader_ = XotsNativeFacesRunner.class.getClassLoader();
      } else if (classLoader_ instanceof ModuleClassLoader) {
        throw new IllegalArgumentException("Can't queue a " + XotsNativeFacesRunner.class.getName()
View Full Code Here

  }

  @Override
  protected void preRun() {
    if (module_ != null) {
      NotesContext nctx = new NotesContext(module_);
      NotesContext.initThread(nctx);

      LCDAdapterHttpSession httpSession = LCDAdapterHttpSession.getAdaptedSession(module_, "sometestid" + new Date(),
          module_.getServletContext());
      HttpServletRequest request = new StubHttpServletRequest(httpSession, new StubServerPrincipal());
      HttpServletResponse response = new StubHttpServletResponse();
      try {
        nctx.initRequest(request);
      } catch (ServletException e) {
        e.printStackTrace();
      }
      FacesContextFactory contextFactory = (FacesContextFactory) FactoryFinder.getFactory(FactoryFinder.FACES_CONTEXT_FACTORY);
      contextFactory.getFacesContext(module_.getServletContext(), request, response, dummyLifeCycle);
View Full Code Here

TOP

Related Classes of com.ibm.domino.xsp.module.nsf.NotesContext

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.