Examples of ApplicationContext


Examples of org.apache.tiles.request.ApplicationContext

     */
    @Test
    public void testRender() throws IOException {
        Request request = createMock(Request.class);
        Writer writer = createMock(Writer.class);
        ApplicationContext applicationContext = createMock(ApplicationContext.class);
        ApplicationResource applicationResource = createMock(ApplicationResource.class);
        expect(applicationResource.getInputStream()).andReturn(getClass().getResource("/test.html").openStream());

        Map<String,Object> context = Collections.singletonMap("testKey", (Object)"test value");

        expect(request.getApplicationContext()).andReturn(applicationContext);
        expect(applicationContext.getResource(isA(String.class))).andReturn(applicationResource).anyTimes();
        expect(request.getAvailableScopes()).andReturn(Arrays.asList("request", "session", "application"));
        expect(request.getContext("request")).andReturn(context);
        expect(request.getContext("session")).andReturn(Collections.<String,Object>emptyMap());
        expect(request.getContext("application")).andReturn(Collections.<String,Object>emptyMap());
        expect(request.getWriter()).andReturn(writer);
View Full Code Here

Examples of org.apache.webbeans.context.ApplicationContext

        this.webBeansContext = webBeansContext;
        supportsConversation =  webBeansContext.getOpenWebBeansConfiguration().supportsConversation();
        failoverService = webBeansContext.getService(FailOverService.class);
        conversationManager = webBeansContext.getConversationManager();

        sharedApplicationContext = new ApplicationContext();
        sharedApplicationContext.setActive(true);
    }
View Full Code Here

Examples of org.codehaus.loom.interfaces.ApplicationContext

                    final Logger childLogger =
                        getLogger().getChildLogger( name );
                    org.codehaus.dna.impl.ContainerUtil.enableLogging(
                        newApp, childLogger );

                    final ApplicationContext context =
                        createApplicationContext( entry );
                    newApp.setApplicationContext( context );

                    org.codehaus.dna.impl.ContainerUtil.initialize( newApp );
View Full Code Here

Examples of org.exoplatform.services.rest.ApplicationContext

   public Iterator<FileItem> readFrom(Class<Iterator<FileItem>> type, Type genericType, Annotation[] annotations,
      MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException
   {
      try
      {
         ApplicationContext context = ApplicationContextImpl.getCurrent();
         int bufferSize =
            context.getProperties().get(RequestHandler.WS_RS_BUFFER_SIZE) == null
               ? RequestHandler.WS_RS_BUFFER_SIZE_VALUE : Integer.parseInt(context.getProperties().get(
                  RequestHandler.WS_RS_BUFFER_SIZE));
         File repo = new File(context.getProperties().get(RequestHandler.WS_RS_TMP_DIR));

         DefaultFileItemFactory factory = new DefaultFileItemFactory(bufferSize, repo);
         final FileUpload upload = new FileUpload(factory);

         return SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<Iterator<FileItem>>()
View Full Code Here

Examples of org.fenrir.yggdrasil.core.ApplicationContext

    private ApplicationWindowListener windowListener;

    private ApplicationWindowManager()
    {
      windowListener = new ApplicationWindowListener();
      ApplicationContext applicationContext = ApplicationContext.getInstance();
        applicationContext.injectMembers(windowListener);
    }
View Full Code Here

Examples of org.jboss.arquillian.core.spi.context.ApplicationContext

      handledThrowables.get().clear();
     
      List<ObserverMethod> observers = resolveObservers(event.getClass());
      List<ObserverMethod> interceptorObservers = resolveInterceptorObservers(event.getClass());
     
      ApplicationContext context = (ApplicationContext)getScopedContext(ApplicationScoped.class);
      // We need to know if we were to the one to Activate it to avoid:
      // * nested ApplicationContexts
      // * ending the scope to soon (to low in the stack)
      boolean activatedApplicationContext = false;
      try
      {
         if(!context.isActive()) {
            context.activate();
            activatedApplicationContext = true;
         }
         new EventContextImpl<T>(this, interceptorObservers, observers, nonManagedObserver, event).proceed();
      }
      catch (Exception e)
      {
         Throwable fireException = e;
         if(fireException instanceof InvocationException)
         {
            fireException = fireException.getCause();
         }
         if(handledThrowables.get().contains(fireException.getClass()))
         {
            UncheckedThrow.throwUnchecked(fireException);
         }
         else
         {
            fireException(fireException);
         }
      }
      finally
      {
         debug(event, false);
         if(activatedApplicationContext && context.isActive()) {
            context.deactivate();
         }
      }
   }
View Full Code Here

Examples of org.jboss.arquillian.impl.core.spi.context.ApplicationContext

   /**
    *
    */
   private void createApplicationContextAndActivate()
   {   
      ApplicationContext context = new ApplicationContextImpl();
      context.activate();
      context.getObjectStore().add(Injector.class, InjectorImpl.of(this));
      contexts.add(context);
   }
View Full Code Here

Examples of org.jboss.bpm.console.client.ApplicationContext

  boolean isRiftsawInstance = false;

  public InstanceDataView() {
    super();
    this.setPadding(5);
    ApplicationContext appContext = Registry.get(ApplicationContext.class);
    isRiftsawInstance = appContext.getConfig().getProfileName()
        .equals("BPEL Console");
  }
View Full Code Here

Examples of org.jboss.seam.contexts.ApplicationContext

      ExternalContext externalContext = new MockExternalContext();
      MockFacesContext facesContext = new MockFacesContext( externalContext, new MockApplication() );
      facesContext.setCurrent().createViewRoot();
      facesContext.getApplication().setStateManager( new SeamStateManager( facesContext.getApplication().getStateManager() ) );
     
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      installComponents(appContext);
      return facesContext;
   }
View Full Code Here

Examples of org.jboss.seam.contexts.ApplicationContext

   public void testBijectionInterceptor() throws Exception
   {
      MockServletContext servletContext = new MockServletContext();
      ServletLifecycle.beginApplication(servletContext);
      MockExternalContext externalContext = new MockExternalContext(servletContext);
      Context appContext = new ApplicationContext( externalContext.getApplicationMap() );
      appContext.set( Seam.getComponentName(Init.class), new Init() );
      appContext.set(
            Seam.getComponentName(ConversationEntries.class) + ".component",
            new Component(ConversationEntries.class, appContext)
         );
      appContext.set(
            Seam.getComponentName(Manager.class) + ".component",
            new Component(Manager.class, appContext)
         );
      appContext.set(
            Seam.getComponentName(Foo.class) + ".component",
            new Component(Foo.class, appContext)
         );
      appContext.set(
            Seam.getComponentName(Factory.class) + ".component",
            new Component(Factory.class, appContext)
         );

      FacesLifecycle.beginRequest(externalContext);
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.