Examples of Bootstrap


Examples of bomberman.login.Bootstrap

      pr.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
      pr.put("java.naming.provider.url", "iiop://"+serverAddress+":"+cosServerPort);
      InitialContext ic = new InitialContext(pr);
      Object objRef = ic.lookup("AuthServer");

      Bootstrap  bootstrap = (Bootstrap)PortableRemoteObject.narrow(objRef, Bootstrap.class);
      Runnable client = bootstrap.getClient();
      client.run();     
    }
    catch (Exception e) {
      e.printStackTrace();
    }
View Full Code Here

Examples of com.netflix.governator.guice.annotations.Bootstrap

                // Iterate through all annotations of the main class and convert them into
                // their BootstrapModules
                for (final Annotation annot : main.getDeclaredAnnotations()) {
                    final Class<? extends Annotation> type = annot.annotationType();
                    LOG.info("Found bootstrap annotation {}", type.getName());
                    Bootstrap bootstrap = type.getAnnotation(Bootstrap.class);
                    if (bootstrap != null) {
                      boolean added = false;
                      // This is a suite
                      if (!bootstrap.value().equals(Bootstrap.NullLifecycleInjectorBuilderSuite.class)) {
                            LOG.info("Adding Suite {}", bootstrap.bootstrap());
                        suites
                              .addBinding()
                              .to(bootstrap.value())
                              .asEagerSingleton();
                        added = true;
                      }
                      // This is a bootstrap module
                      if (!bootstrap.bootstrap().equals(Bootstrap.NullBootstrapModule.class)) {
                        Preconditions.checkState(added==false, bootstrap.annotationType().getName() + " already added as a LifecycleInjectorBuilderSuite");
                        added = true;
                            LOG.info("Adding BootstrapModule {}", bootstrap.bootstrap());
                          bootstrapModules
                              .addBinding()
                              .to(bootstrap.bootstrap())
                              .asEagerSingleton();
                          // Make this annotation injectable into any plain Module
                          builder.withAdditionalBootstrapModules(forAnnotation(annot));
                      }
                      // This is a plain guice module
                      if (!bootstrap.module().equals(Bootstrap.NullModule.class)) {
                        Preconditions.checkState(added==false, bootstrap.annotationType().getName() + " already added as a BootstrapModule");
                        added = true;
                            LOG.info("Adding Module {}", bootstrap.bootstrap());
                          builder.withAdditionalModuleClasses(bootstrap.module());
                          // Make the annotation injectable into the module
                          builder.withAdditionalBootstrapModules(forAnnotation(annot));
                      }
                           
                        // Makes the annotation injectable into LifecycleInjectorBuilderSuite
View Full Code Here

Examples of com.proofpoint.bootstrap.Bootstrap

    public static void main(String[] args)
            throws Exception
    {
        try {
            Bootstrap app = bootstrapApplication("skeleton")
                    .withModules(
                            new NodeModule(),
                            new DiscoveryModule(),
                            new HttpServerModule(),
                            new JsonModule(),
                            explicitJaxrsModule(),
                            new MBeanModule(),
                            new JmxModule(),
                            new JmxHttpModule(),
                            new LogJmxModule(),
                            new HttpEventModule(),
                            new ReportingModule(),
                            new ReportingClientModule(),
                            new TraceTokenModule(),
                            new MainModule()
                    );

            Injector injector = app.initialize();
            injector.getInstance(Announcer.class).start();
        }
        catch (Throwable e) {
            log.error(e);
            System.exit(1);
View Full Code Here

Examples of gov.nasa.arc.mct.components.Bootstrap

    }
   
    @SuppressWarnings("unchecked")
    @Test
    public void testPluginBootstraps() {
        final Bootstrap mockGlobal = Mockito.mock(Bootstrap.class);
        final Bootstrap mockNonGlobal = Mockito.mock(Bootstrap.class);
        Mockito.when(mockGlobal.isGlobal()).thenReturn(true);
        Mockito.when(mockNonGlobal.isGlobal()).thenReturn(false);
       
        class BootstrapComponent extends AbstractComponent {
            private boolean global;

            public BootstrapComponent(boolean global) {
View Full Code Here

Examples of hu.sztaki.ilab.longneck.bootstrap.Bootstrap

                    }
                }
            }

            // Create and initialize bootstrap
            Bootstrap bootstrap = new Bootstrap(runtimeProperties);

            if (!runtimeProperties.containsKey("executeUtility")) {
                bootstrap.run();
            } else {
                ApplicationContext context = bootstrap.getApplicationContext();
                UtilityRunner ur = (UtilityRunner) context.getBean(runtimeProperties
                    .getProperty("executeUtility"));
                ur.run(runtimeProperties);
            }

            bootstrap.close();

        } catch (ParseException ex) {
            LOG.error("Invalid command line specified.", ex);
        } catch (RuntimeException ex) {
            LOG.error("Error during execution.", getRootCause(ex));
View Full Code Here

Examples of io.airlift.bootstrap.Bootstrap

        ImmutableList.Builder<Module> builder = ImmutableList.<Module>builder()
                .add(new PrestoVerifierModule())
                .addAll(getAdditionalModules());

        Bootstrap app = new Bootstrap(builder.build());
        Injector injector = app.strictConfig().initialize();

        VerifierConfig config = injector.getInstance(VerifierConfig.class);
        injector.injectMembers(this);
        EventClient eventClient = Iterables.getOnlyElement(injector.getInstance(Key.get(new TypeLiteral<Set<EventClient>>() {})));
View Full Code Here

Examples of io.airlift.bootstrap.Bootstrap

    @BeforeMethod
    public void setup()
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new TestingNodeModule(),
                new InMemoryEventModule(),
                new TestingHttpServerModule(),
                new JsonModule(),
                new JaxrsModule(true),
                new Module()
                {
                    @Override
                    public void configure(Binder binder)
                    {
                        jaxrsBinder(binder).bind(QueryResource.class);
                        jaxrsBinder(binder).bind(StageResource.class);
                        jaxrsBinder(binder).bind(TaskResource.class);
                        binder.bind(QueryManager.class).to(MockQueryManager.class).in(Scopes.SINGLETON);
                        binder.bind(MockTaskManager.class).in(Scopes.SINGLETON);
                        binder.bind(TaskManager.class).to(Key.get(MockTaskManager.class)).in(Scopes.SINGLETON);
                        jaxrsBinder(binder).bind(PagesResponseWriter.class);
                        binder.bind(InternalNodeManager.class).to(InMemoryNodeManager.class).in(Scopes.SINGLETON);
                        binder.bind(NodeManager.class).to(Key.get(InternalNodeManager.class)).in(Scopes.SINGLETON);
                        binder.bind(LocationFactory.class).to(HttpLocationFactory.class).in(Scopes.SINGLETON);
                    }
                });

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .initialize();

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
View Full Code Here

Examples of io.airlift.bootstrap.Bootstrap

    {
        checkNotNull(connectorId, "connectorId is null");
        checkNotNull(config, "config is null");

        try {
            Bootstrap app = new Bootstrap(
                    new JsonModule(),
                    new KafkaConnectorModule(),
                    new Module()
                    {
                        @Override
                        public void configure(Binder binder)
                        {
                            binder.bindConstant().annotatedWith(Names.named("connectorId")).to(connectorId);
                            binder.bind(TypeManager.class).toInstance(typeManager);
                            binder.bind(NodeManager.class).toInstance(nodeManager);

                            if (tableDescriptionSupplier.isPresent()) {
                                binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, KafkaTopicDescription>>>() {}).toInstance(tableDescriptionSupplier.get());
                            }
                            else {
                                binder.bind(new TypeLiteral<Supplier<Map<SchemaTableName, KafkaTopicDescription>>>() {}).to(KafkaTableDescriptionSupplier.class).in(Scopes.SINGLETON);
                            }
                        }
                    }
            );

            Injector injector = app.strictConfig()
                    .doNotInitializeLogging()
                    .setRequiredConfigurationProperties(config)
                    .setOptionalConfigurationProperties(optionalConfig)
                    .initialize();
View Full Code Here

Examples of io.airlift.bootstrap.Bootstrap

        checkNotNull(requiredConfig, "requiredConfig is null");
        checkNotNull(optionalConfig, "optionalConfig is null");

        try {
            // A plugin is not required to use Guice; it is just very convenient
            Bootstrap app = new Bootstrap(
                    new JsonModule(),
                    new ExampleModule(connectorId, typeManager));

        Injector injector = app
                    .strictConfig()
                    .doNotInitializeLogging()
                    .setRequiredConfigurationProperties(requiredConfig)
                    .setOptionalConfigurationProperties(optionalConfig)
                    .initialize();
View Full Code Here

Examples of io.airlift.bootstrap.Bootstrap

    @BeforeMethod
    public void setup()
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new TestingNodeModule(),
                new InMemoryEventModule(),
                new TestingHttpServerModule(),
                new JsonModule(),
                new JaxrsModule(),
                new Module()
                {
                    @Override
                    public void configure(Binder binder)
                    {
                        binder.bind(QueryResource.class).in(Scopes.SINGLETON);
                        binder.bind(StageResource.class).in(Scopes.SINGLETON);
                        binder.bind(TaskResource.class).in(Scopes.SINGLETON);
                        binder.bind(QueryManager.class).to(MockQueryManager.class).in(Scopes.SINGLETON);
                        binder.bind(MockTaskManager.class).in(Scopes.SINGLETON);
                        binder.bind(TaskManager.class).to(Key.get(MockTaskManager.class)).in(Scopes.SINGLETON);
                        binder.bind(PagesMapper.class).in(Scopes.SINGLETON);
                        binder.bind(InternalNodeManager.class).to(InMemoryNodeManager.class).in(Scopes.SINGLETON);
                        binder.bind(NodeManager.class).to(Key.get(InternalNodeManager.class)).in(Scopes.SINGLETON);
                        binder.bind(LocationFactory.class).to(HttpLocationFactory.class).in(Scopes.SINGLETON);
                    }
                });

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .initialize();

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
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.