Package org.jboss.errai.bus.server

Examples of org.jboss.errai.bus.server.ErraiBootstrapFailure


    }

    final String dispatchImplKey = "errai.dispatcher_implementation";
    if (erraiServiceConfig.containsKey(dispatchImplKey)) {
      if (AsyncDispatcher.class.getName().equals(erraiServiceConfig.getString(dispatchImplKey))) {
        throw new ErraiBootstrapFailure("Cannot start Errai CDI. You have have configured the service to use the " +
                AsyncDispatcher.class.getName()
                + " dispatcher implementation. Due to limitations of Weld, you must use the " +
                SimpleDispatcher.class.getName() + " in order to use this module.");
      }
    }
View Full Code Here


            }
            catch (ErraiBootstrapFailure e) {
                throw e;
            }
            catch (Exception e) {
                throw new ErraiBootstrapFailure("cannot configure authentication adapter", e);
            }
        }


        /*** Dispatcher ***/

        RequestDispatcher dispatcher = createInjector(new AbstractModule() {
            @Override
            protected void configure() {
                Class<? extends RequestDispatcher> dispatcherImplementation = SimpleDispatcher.class;

                if (config.hasProperty(ErraiServiceConfigurator.ERRAI_DISPATCHER_IMPLEMENTATION)) {
                    try {
                        dispatcherImplementation = Class.forName(config.getProperty(ErraiServiceConfigurator.ERRAI_DISPATCHER_IMPLEMENTATION))
                                .asSubclass(RequestDispatcher.class);
                    }
                    catch (Exception e) {
                        throw new ErraiBootstrapFailure("could not load request dispatcher implementation class", e);
                    }
                }

                log.info("using dispatcher implementation: " + dispatcherImplementation.getName());

                bind(RequestDispatcher.class).to(dispatcherImplementation);
                bind(ErraiService.class).toInstance(context.getService());
                bind(MessageBus.class).toInstance(context.getBus());
                bind(ErraiServiceConfigurator.class).toInstance(config);
            }
        }).getInstance(RequestDispatcher.class);

        context.getService().setDispatcher(dispatcher);

        /*** Session Provider ***/

        SessionProvider sessionProvider = createInjector(new AbstractModule() {
            @Override
            protected void configure() {
                Class<? extends SessionProvider> sessionProviderImplementation = HttpSessionProvider.class;

                if (config.hasProperty(ErraiServiceConfigurator.ERRAI_SESSION_PROVIDER_IMPLEMENTATION)) {
                    try {
                        sessionProviderImplementation = Class.forName(config.getProperty(ErraiServiceConfigurator.ERRAI_SESSION_PROVIDER_IMPLEMENTATION))
                                .asSubclass(SessionProvider.class);
                    }
                    catch (Exception e) {
                        throw new ErraiBootstrapFailure("could not load session provider implementation class", e);
                    }
                }

                log.info("using session provider implementation: " + sessionProviderImplementation.getName());

View Full Code Here

                log.info("Marked " + cls + " as serializable.");
                loadedComponents.add(cls.getName());
                config.getSerializableTypes().add(cls);
              }
              catch (Exception e) {
                throw new ErraiBootstrapFailure(e);
              }

            }

            break;
          }
        }
      }
    }
    catch (MissingResourceException e) {
      throw new ErraiBootstrapFailure("unable to find ErraiApp.properties in the classpath.");
    }
  }
View Full Code Here

                context.defer(create);
              }

            }
            catch (Throwable e) {
              throw new ErraiBootstrapFailure("could not initialize extension: " + loadClass.getName(), e);
            }
          }
        }
      });
View Full Code Here

      }
      catch (ErraiBootstrapFailure e) {
        throw e;
      }
      catch (Exception e) {
        throw new ErraiBootstrapFailure("cannot configure authentication adapter", e);
      }
    }


    /*** Dispatcher ***/

    RequestDispatcher dispatcher = createInjector(new AbstractModule() {
      @Override
      protected void configure() {
        Class<? extends RequestDispatcher> dispatcherImplementation = SimpleDispatcher.class;

        if (config.hasProperty(ErraiServiceConfigurator.ERRAI_DISPATCHER_IMPLEMENTATION)) {
          try {
            dispatcherImplementation = Class.forName(config.getProperty(ErraiServiceConfigurator.ERRAI_DISPATCHER_IMPLEMENTATION))
                .asSubclass(RequestDispatcher.class);
          }
          catch (Exception e) {
            throw new ErraiBootstrapFailure("could not load request dispatcher implementation class", e);
          }
        }

        log.info("using dispatcher implementation: " + dispatcherImplementation.getName());

        bind(RequestDispatcher.class).to(dispatcherImplementation);
        bind(ErraiService.class).toInstance(context.getService());
        bind(MessageBus.class).toInstance(context.getBus());
        bind(ErraiServiceConfigurator.class).toInstance(config);
      }
    }).getInstance(RequestDispatcher.class);

    context.getService().setDispatcher(dispatcher);

    /*** Session Provider ***/

    SessionProvider sessionProvider = createInjector(new AbstractModule() {
      @Override
      protected void configure() {
        Class<? extends SessionProvider> sessionProviderImplementation = HttpSessionProvider.class;

        if (config.hasProperty(ErraiServiceConfigurator.ERRAI_SESSION_PROVIDER_IMPLEMENTATION)) {
          try {
            sessionProviderImplementation = Class.forName(config.getProperty(ErraiServiceConfigurator.ERRAI_SESSION_PROVIDER_IMPLEMENTATION))
                .asSubclass(SessionProvider.class);
          }
          catch (Exception e) {
            throw new ErraiBootstrapFailure("could not load session provider implementation class", e);
          }
        }

        log.info("using session provider implementation: " + sessionProviderImplementation.getName());

View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.server.ErraiBootstrapFailure

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.