Package org.jboss.errai.bus.server.service

Examples of org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl


    return null;
  }

  private static void createRPCScaffolding(final Class remoteIface, final Class<?> type, final BootstrapContext context) {

    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();
    final Injector injector = Guice.createInjector(new AbstractModule() {
      @Override
      protected void configure() {
        bind(MessageBus.class).toInstance(context.getBus());
        bind(RequestDispatcher.class).toInstance(context.getService().getDispatcher());
        bind(TaskManager.class).toInstance(TaskManagerFactory.get());

        // Add any extension bindings.
        for (Map.Entry<Class<?>, ResourceProvider> entry : config.getExtensionBindings().entrySet()) {
          bind(entry.getKey()).toProvider(new GuiceProviderProxy(entry.getValue()));
        }
      }
    });
View Full Code Here


class DiscoverServices implements BootstrapExecution {
  private Logger log = LoggerFactory.getLogger(DiscoverServices.class);

  @Override
  public void execute(final BootstrapContext context) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();

    if (isAutoScanEnabled(config)) {
      log.debug("begin meta data scanning ...");

      // meta data scanner
View Full Code Here

* @date: May 3, 2010
* @see org.jboss.errai.common.client.api.ResourceProvider
*/
class DefaultResources implements BootstrapExecution {
  public void execute(final BootstrapContext context) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context
        .getConfig();

    config.getResourceProviders().put(MessageBus.class.getName(),
        new BusProvider(context.getBus()));
    config.getResourceProviders().put(RequestDispatcher.class.getName(),
        new DispatcherProvider(context.getService().getDispatcher()));

    // configure the server-side taskmanager

    final TaskManager taskManager = resolveTaskManager(config);
View Full Code Here

*/
public class LoadExtensions implements BootstrapExecution {
  private Logger log = LoggerFactory.getLogger(LoadExtensions.class);

  public void execute(final BootstrapContext context) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();

    boolean autoScanModules = true;

    final Set<String> loadedComponents = new HashSet<String>();

    /*** Extensions  ***/
    if (config.hasProperty("errai.auto_load_extensions")) {
      autoScanModules = Boolean.parseBoolean(config.getProperty("errai.auto_load_extensions"));
    }
    if (autoScanModules) {

      log.info("searching for errai extensions ...");

      final ErraiConfig erraiConfig = new ErraiConfig() {
        public void addBinding(Class<?> type, ResourceProvider provider) {
          config.getExtensionBindings().put(type, provider);
        }

        public void addResourceProvider(String name, ResourceProvider provider) {
          config.getResourceProviders().put(name, provider);
        }

        public void addSerializableType(Class<?> type) {
          log.debug("marked " + type + " as serializable.");
          loadedComponents.add(type.getName());
          config.getSerializableTypes().add(type);
        }
      };

      // Search for Errai extensions.
      MetaDataScanner scanner = context.getScanner();

      Set<Class<?>> extensionComponents = scanner.getTypesAnnotatedWith(ExtensionComponent.class);
      for (Class<?> loadClass : extensionComponents) {
        if (ErraiConfigExtension.class.isAssignableFrom(loadClass)) {
          // We have an annotated ErraiConfigExtension.  So let's configure it.
          final Class<? extends ErraiConfigExtension> clazz =
              loadClass.asSubclass(ErraiConfigExtension.class);


          log.info("found extension " + clazz.getName());

          try {

            final Runnable create = new Runnable() {
              public void run() {
                AbstractModule module = new AbstractModule() {
                  @Override
                  protected void configure() {
                    bind(ErraiConfigExtension.class).to(clazz);
                    bind(ErraiServiceConfigurator.class).toInstance(config);
                    bind(MessageBus.class).toInstance(context.getBus());

                    // Add any extension bindings.
                    for (Map.Entry<Class<?>, ResourceProvider> entry : config.getExtensionBindings().entrySet()) {
                      bind(entry.getKey()).toProvider(new GuiceProviderProxy(entry.getValue()));
                    }
                  }
                };
                Guice.createInjector(module)
View Full Code Here

* @author: Heiko Braun <hbraun@redhat.com>
* @date: May 3, 2010
*/
class RegisterEntities implements BootstrapExecution {
  public void execute(BootstrapContext context) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();
  }
View Full Code Here

class DefaultComponents implements BootstrapExecution {
  private Logger log = LoggerFactory.getLogger(DefaultComponents.class);

  public void execute(final BootstrapContext context) {

    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();

    /*** Dispatcher ***/

    final RequestDispatcher dispatcher = createInjector(new AbstractModule() {

View Full Code Here

        return ErraiServiceSingleton.getService();
      }

      final ServletContext context = config.getServletContext();

      final ErraiServiceConfigurator configurator = new ErraiServiceConfiguratorImpl();

      final String autoDiscoverServices
              = ServletInitAttribs.AUTO_DISCOVER_SERVICES.getInitOrContextValue(config, "false");

      if (autoDiscoverServices != null) {
View Full Code Here

   *
   * @param queueSize The size of the underlying worker queue.
   */
  public PooledExecutorService(int queueSize) {
    this(queueSize, SaturationPolicy.valueOf(
            ErraiConfigAttribs.SATURATION_POLICY.get(new ErraiServiceConfiguratorImpl())));
  }
View Full Code Here

*/
public class EntityProcessor implements MetaDataProcessor {
  private Logger log = LoggerFactory.getLogger(EntityProcessor.class);

  public void process(BootstrapContext context, MetaDataScanner scanner) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context.getConfig();
    final Set<Class<?>> entities = scanner.getTypesAnnotatedWith(ExposeEntity.class);

    for (Class<?> loadClass : entities) {
      log.info("Marked " + loadClass + " as serializable.");
      config.getSerializableTypes().add(loadClass);
    //  markIfEnumType(loadClass);
    }

    Properties props = scanner.getProperties("ErraiApp.properties");
    if (props != null) {
      log.info("Checking ErraiApp.properties for configured types ...");

      Iterator<Object> it = props.keySet().iterator();
      while (it.hasNext()) {
        String key = (String) it.next();
        if (key.equals(ErraiServiceConfigurator.CONFIG_ERRAI_SERIALIZABLE_TYPE)) {
          for (String s : props.getProperty(key).split(" ")) {
            try {
              Class<?> cls = Class.forName(s.trim());
              log.info("Marked " + cls + " as serializable.");
              config.getSerializableTypes().add(cls);
         //     markIfEnumType(cls);

            }
            catch (Exception e) {
              throw new ErraiBootstrapFailure(e);
View Full Code Here

* @date: May 3, 2010
* @see org.jboss.errai.common.client.api.ResourceProvider
*/
class DefaultResources implements BootstrapExecution {
  public void execute(BootstrapContext context) {
    final ErraiServiceConfiguratorImpl config = (ErraiServiceConfiguratorImpl) context
        .getConfig();

    config.getResourceProviders().put(MessageBus.class.getName(),
        new BusProvider(context.getBus()));
    config.getResourceProviders().put(RequestDispatcher.class.getName(),
        new DispatcherProvider(context.getService().getDispatcher()));

    // configure the server-side taskmanager

    final TaskManager taskManager = resolveTaskManager(config);
View Full Code Here

TOP

Related Classes of org.jboss.errai.bus.server.service.ErraiServiceConfiguratorImpl

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.