Examples of Injector


Examples of de.mhus.lib.lang.Injector

    act.addMap(XLayElement.class, "content", DefaultContentArea.class);
    act.addMap(XLayElement.class, "breadcrumb", DefaultBreadcrumb.class);
    act.addMap(XLayElement.class, "login", DefaultLogin.class);

    InjectorMap injector = new InjectorMap();
    injector.put(DesktopInject.class, new Injector() {
     
      @Override
      public void doInject(Object obj) throws Exception {
        ((DesktopInject)obj).setDesktop(Desktop.this);
      }
View Full Code Here

Examples of juzu.impl.inject.spi.Injector

          }
        }
      };

      //
      Injector injector = bridgeConfig.injectorProvider.get();
      if (injector instanceof SpringInjector) {
        SpringInjector springInjector = (SpringInjector)injector;
        Object parent = getServletContext().getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
        if (parent != null) {
          springInjector.setParent(parent);
        }
      }

      //
      ModuleContextImpl module = (ModuleContextImpl)getServletContext().getAttribute("juzu.module");
      if (module == null) {
        getServletContext().setAttribute("juzu.module", module = new ModuleContextImpl(servletLogger, bridgeContext, resolver));
      }

      // Get asset server
      AssetServer server = (AssetServer)getServletContext().getAttribute("asset.server");
      if (server == null) {
        server = new AssetServer();
        getServletContext().setAttribute("asset.server", server);
      }

      //
      if (injector.isProvided()) {
        bridge = new ProvidedBridge(bridgeContext, this.bridgeConfig, server, resolver, injector);
      } else {
        bridge = new ApplicationBridge(module, bridgeContext, this.bridgeConfig, server, resolver, injector);
      }
    }
View Full Code Here

Examples of net.aufdemrand.denizen.utilities.command.Injector

            // Create the dNPC Registry
            dNPCRegistry = new dNPCRegistry(this);

            // Create our CommandManager to handle '/denizen' commands
            commandManager = new CommandManager();
            commandManager.setInjector(new Injector(this));
            commandManager.register(DenizenCommandHandler.class);

            // If Citizens is enabled, let it handle '/npc' commands
            if (Depends.citizens != null) {
                Depends.citizens.registerCommandClass(NPCCommandHandler.class);
View Full Code Here

Examples of org.apache.camel.spi.Injector

*/
public class InjectorDefaultsToReflectionTest extends TestCase {
    private static final transient Log LOG = LogFactory.getLog(InjectorDefaultsToReflectionTest.class);
   
    public void testInjectorIsReflectionByDefault() throws Exception {
        Injector injector = new DefaultCamelContext().getInjector();
        assertTrue("Injector should be reflection based but was: " + injector,
                   injector instanceof ReflectionInjector);
        LOG.debug("Found injector: " + injector);
    }
View Full Code Here

Examples of org.apache.cayenne.di.Injector

                binder.bind(ConfigurationNameMapper.class).to(
                        DefaultConfigurationNameMapper.class);
            }
        };

        Injector injector = DIBootstrap.createInjector(testModule);

        // create and initialize loader instance to test
        XMLDataChannelDescriptorLoader loader = new XMLDataChannelDescriptorLoader();
        injector.injectMembers(loader);

        String testConfigName = "testConfig1";
        String baseUrl = getClass().getPackage().getName().replace('.', '/');
        URL url = getClass().getClassLoader().getResource(
                baseUrl + "/cayenne-" + testConfigName + ".xml");
View Full Code Here

Examples of org.apache.nutch.crawl.Injector

    addUrl(urls,"exception.html");
   
    CrawlDBTestUtil.generateSeedList(fs, urlPath, urls);
   
    //inject
    Injector injector=new Injector(conf);
    injector.inject(crawldbPath, urlPath);

    //generate
    Generator g=new Generator(conf);
    Path[] generatedSegment = g.generate(crawldbPath, segmentsPath, 1,
        Long.MAX_VALUE, Long.MAX_VALUE, false, false);
View Full Code Here

Examples of org.apache.tuscany.core.injection.Injector

        boolean eagerInit = false;
        EventInvoker destroyInvoker = null;
        for (Field field : fields) {
            ComponentName compName = field.getAnnotation(ComponentName.class);
            if (compName != null) {
                Injector injector = new FieldInjector(field, new SingletonObjectFactory(name));
                injectors.add(injector);
            }
            org.osoa.sca.annotations.Context context = field.getAnnotation(org.osoa.sca.annotations.Context.class);
            if (context != null) {
                Injector injector = new FieldInjector(field, new SingletonObjectFactory(moduleComponentContext));
                injectors.add(injector);
            }
        }
        for (Method method : methods) {
            // FIXME Java5
            Init init = method.getAnnotation(Init.class);
            if (init != null && initInvoker == null) {
                initInvoker = new MethodEventInvoker(method);
                eagerInit = init.eager();
                continue;
            }
            Destroy destroy = method.getAnnotation(Destroy.class);
            if (destroy != null && destroyInvoker == null) {
                destroyInvoker = new MethodEventInvoker(method);
                continue;
            }
            ComponentName compName = method.getAnnotation(ComponentName.class);
            if (compName != null) {
                Injector injector = new MethodInjector(method, new SingletonObjectFactory(name));
                injectors.add(injector);
            }
            org.osoa.sca.annotations.Context context = method.getAnnotation(org.osoa.sca.annotations.Context.class);
            if (context != null) {
                Injector injector = new MethodInjector(method, new SingletonObjectFactory(moduleComponentContext));
                injectors.add(injector);
            }
        }
        boolean stateless = (scope == Scope.INSTANCE);
        return new JavaAtomicContext("foo", new PojoObjectFactory(JavaIntrospectionHelper
View Full Code Here

Examples of org.apache.wicket.injection.Injector

  /**
   * Test abort injection on boundary class
   */
  public void testBreakOnBoundary()
  {
    Injector injector = new Injector()
    {
      protected boolean isBoundaryClass(Class clazz)
      {
        return clazz.equals(InternalTestObject.class);
      }
    };

    TestObject testObject = new TestObject();

    injector.inject(testObject, factory);

    assertTrue(testObject.getDependency1() == null);
    assertEquals(testObject.getDependency2().getMessage(), "dont-inject");
    assertEquals(testObject.getDependency3().getMessage(), "dont-inject");
    assertEquals(testObject.getDependency4().getMessage(), "inject");
View Full Code Here

Examples of org.elasticsearch.common.inject.Injector

    }

    private AnalysisService testSimpleConfiguration(Settings settings) {
        Index index = new Index("test");

        Injector parentInjector = new ModulesBuilder().add(new SettingsModule(settings),
                new EnvironmentModule(new Environment(settings)),
                new IndicesAnalysisModule()).createInjector();
        Injector injector = new ModulesBuilder().add(
                new IndexSettingsModule(index, settings),
                new IndexNameModule(index),
                new AnalysisModule(settings, parentInjector.getInstance(IndicesAnalysisService.class)).addProcessor(new HunspellAnalysisBinderProcessor())).createChildInjector(parentInjector);

        AnalysisService analysisService = injector.getInstance(AnalysisService.class);       
        return analysisService;
    }
View Full Code Here

Examples of org.exoplatform.portal.mop.i18n.Injector

    }

    @Override
    protected void onOpenSession(SessionContext context) {
        POMSession session = new POMSession(manager, this, context);
        context.getSession().addEventListener(new Injector(context.getSession()));
        context.setAttachment("mopsession", session);
    }
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.