Package org.springframework.context

Examples of org.springframework.context.ApplicationContext.containsBean()


        Node node = NodeFactory.newInstance().createNode("context/access/ContextAccess.composite", new Contribution("c1", location));
        node.start();
       
        // Code: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("CalculatorServiceBean"))
            System.out.println("CalculatorServiceBean is now available for use...");
             
        CalculatorService calculatorService =
            ((Client)node).getService(CalculatorService.class, "CalculatorServiceComponent");
               
View Full Code Here


        Node node = NodeFactory.newInstance().createNode("context/multiple/MultipleContext.composite", new Contribution("c1", location));
        node.start();
       
        // Method 1: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("StockQuoteServiceBean"))
            System.out.println("StockQuoteServiceBean is now available for use...");       
       
        System.out.println("Press Enter to Exit...");
        Thread.sleep(1000);
View Full Code Here

        SCANode node = factory.createSCANodeFromClassLoader("StockQuote.composite", StockQuoteServer.class.getClassLoader());
        node.start();
       
        // Method 1: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("StockQuoteServiceBean"))
            System.out.println("StockQuoteServiceBean is now available for use...");       
       
        if (timeout < 0) {
            System.out.println("Press Enter to Exit...");
            System.in.read();
View Full Code Here

        }

        Class pageClass = page.getClass();
        String beanName = toBeanName(pageClass);

        if (applicationContext.containsBean(beanName)
            || applicationContext.containsBean(pageClass.getName())) {

            // Beans are injected through Spring
        } else {
View Full Code Here

        Class pageClass = page.getClass();
        String beanName = toBeanName(pageClass);

        if (applicationContext.containsBean(beanName)
            || applicationContext.containsBean(pageClass.getName())) {

            // Beans are injected through Spring
        } else {

            // Inject any Spring beans into the page instance
View Full Code Here

    ApplicationContext theContext = getApplicationContext();
   
    if( theContext == null ) return null;
   
    // A simple check to see if the context contains this bean, which it should...
    if ( !theContext.containsBean( "testBean" ) ) return null;
   
    return (hello + message);
  } // end sayHello()
 
  /**
 
View Full Code Here

                new SCAContribution("TestContribution", new File("src/main/resources/context/access/").toURL().toString()));
        node.start();
       
        // Code: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("CalculatorServiceBean"))
            System.out.println("CalculatorServiceBean is now available for use...");
             
        CalculatorService calculatorService =
            ((SCAClient)node).getService(CalculatorService.class, "CalculatorServiceComponent");
               
View Full Code Here

        SCANode node = factory.createSCANodeFromClassLoader("context/multiple/StockQuote.composite", StockQuoteServer.class.getClassLoader());
        node.start();
       
        // Method 1: To access the Spring Application Context instance
        ApplicationContext ctx = SCAApplicationContextProvider.getApplicationContext();
        if (ctx.containsBean("StockQuoteServiceBean"))
            System.out.println("StockQuoteServiceBean is now available for use...");       
       
        System.out.println("Press Enter to Exit...");
        Thread.sleep(1000);
View Full Code Here

    if ( servletContextPath.startsWith( "/" ) ) { //$NON-NLS-1$
      servletContextPath = servletContextPath.substring( 1 );
    }
    String beanId = servletContextPath.replaceAll( "/", "-" ); //$NON-NLS-1$ //$NON-NLS-2$

    if ( !beanFactory.containsBean( beanId ) ) {
      throw new GwtRpcProxyException( Messages.getInstance().getErrorString(
          "GwtRpcProxyServlet.ERROR_0001_NO_BEAN_FOUND_FOR_SERVICE", beanId, servletContextPath ) ); //$NON-NLS-1$
    }
    Object target = beanFactory.getBean( beanId );
    return target;
View Full Code Here

    ApplicationContext ctx = this.getContext( servletConfig );

    String beanName = null;

    if ( ( targetBean != null ) && ctx.containsBean( targetBean ) ) {
      if ( ServletToBeanProxy.logger.isDebugEnabled() ) {
        ServletToBeanProxy.logger.debug( "using targetBean" );
      }
      beanName = targetBean;
    } else if ( targetBean != null ) {
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.