org.jboss.errai.ioc.client.container.IOC.getAsyncBeanManager()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(276)

本文整理了Java中org.jboss.errai.ioc.client.container.IOC.getAsyncBeanManager()方法的一些代码示例,展示了IOC.getAsyncBeanManager()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IOC.getAsyncBeanManager()方法的具体详情如下:
包路径:org.jboss.errai.ioc.client.container.IOC
类名称:IOC
方法名:getAsyncBeanManager

IOC.getAsyncBeanManager介绍

暂无

代码示例

代码示例来源:origin: org.jboss.errai/errai-security-client

@Override
 protected void destroyProviderInstance(final RequiredRolesProvider instance) {
  if (dependentProviders.contains(instance)) {
   dependentProviders.remove(instance);
   IOC.getAsyncBeanManager().destroyBean(instance);
  }
 }
}

代码示例来源:origin: errai/errai

@IOCProducer
 public AsyncBeanManager get() {
  return IOC.getAsyncBeanManager();
 }
}

代码示例来源:origin: errai/errai

@Override
 protected void destroyProviderInstance(final RequiredRolesProvider instance) {
  if (dependentProviders.contains(instance)) {
   dependentProviders.remove(instance);
   IOC.getAsyncBeanManager().destroyBean(instance);
  }
 }
}

代码示例来源:origin: errai/errai

private void vote(LoadStrategy<?> strategy) {
 if (cancelled) {
  IOC.getAsyncBeanManager().destroyBean(strategy.getFuture().get());
  return;
 }
 loaded.add(strategy);
 if (loaded.containsAll(loadStrategies)) {
  finishCallback.run();
 }
}

代码示例来源:origin: errai/errai

public void go() {
 IOC.getAsyncBeanManager().lookupBean(Navigation.class).getInstance(new CreationalCallback<Navigation>() {
  @Override
  public void callback(final Navigation navigation) {
   navigation.goToWithRole(uniquePageRole);
  }
 });
}

代码示例来源:origin: errai/errai

/**
 * Cancels the query if it has not yet returned. Already loaded beans are destroyed.
 */
public void cancelQuery() {
 cancelled = true;
 for (final LoadStrategy strategy : loaded) {
  final AsyncBeanFuture future = strategy.getFuture();
  IOC.getAsyncBeanManager().destroyBean(future.get());
 }
 loaded.clear();
 loadStrategies.clear();
}

代码示例来源:origin: org.jboss.errai/errai-navigation

public void go() {
 IOC.getAsyncBeanManager().lookupBean(Navigation.class).getInstance(new CreationalCallback<Navigation>() {
  @Override
  public void callback(final Navigation navigation) {
   navigation.goToWithRole(uniquePageRole);
  }
 });
}

代码示例来源:origin: errai/errai

/**
 * Requests that the specified bean of the specified {@param type} is loaded.
 *
 * @param type
 *     the type of the bean to be loaded. See: {@link AsyncBeanManagerImpl#lookupBean(Class, java.lang.annotation.Annotation...)}
 * @param <T>
 *     the type of bean to be loaded.
 *
 * @return an {@link AsyncBeanFuture} which will house the instance of the bean once it is loaded.
 */
public <T> AsyncBeanFuture<T> load(final Class<T> type) {
 return load(IOC.getAsyncBeanManager().lookupBean(type));
}

代码示例来源:origin: errai/errai

/**
 * Requests that a new instance specified bean of the specified {@param type} is loaded.
 *
 * @param type
 *     the type of the bean to be loaded. See: {@link AsyncBeanManagerImpl#lookupBean(Class, java.lang.annotation.Annotation...)}
 * @param <T>
 *     the type of bean to be loaded.
 *
 * @return an {@link AsyncBeanFuture} which will house the instance of the bean once it is loaded.
 */
public <T> AsyncBeanFuture<T> loadNew(final Class<T> type) {
 return loadNew(IOC.getAsyncBeanManager().lookupBean(type));
}

代码示例来源:origin: org.jboss.errai/errai-ui

private void addWidget(final M m) {
 AsyncBeanDef<C> itemBeanDef = IOC.getAsyncBeanManager().lookupBean(getItemComponentType());
 itemBeanDef.getInstance(new CreationalCallback<C>() {
  @Override
  public void callback(C component) {
   component.setModel(m);
   panel.add(getWidgetForComponent(component));
  }
 });
}

代码示例来源:origin: errai/errai

@Override
 public void run() {
  @SuppressWarnings("rawtypes")
  final Collection<AsyncBeanDef> beans = IOC.getAsyncBeanManager().lookupBeans("animal");
  assertEquals("wrong number of beans", 2, beans.size());
  assertTrue("should contain a pig", containsInstanceOf(beans, Pig.class));
  assertTrue("should contain a cow", containsInstanceOf(beans, Cow.class));
  finishTest();
 }
});

代码示例来源:origin: errai/errai

@Override
 public void run() {
  final Collection<AsyncBeanDef<TestInterface>> asyncBeanDefs = IOC.getAsyncBeanManager().lookupBeans(TestInterface.class);
  assertEquals(2, asyncBeanDefs.size());
  finishTest();
 }
});

代码示例来源:origin: errai/errai

private void addWidget(final M m) {
 AsyncBeanDef<C> itemBeanDef = IOC.getAsyncBeanManager().lookupBean(getItemComponentType());
 itemBeanDef.getInstance(new CreationalCallback<C>() {
  @Override
  public void callback(C component) {
   component.setModel(m);
   panel.add(getWidgetForComponent(component));
  }
 });
}

代码示例来源:origin: errai/errai

@Override
public void onItemRemovedAt(List<M> oldList, int index) {
 Widget widget = panel.getWidget(index);
 panel.remove(index);
 IOC.getAsyncBeanManager().destroyBean(getComponentFromWidget(widget));
}

代码示例来源:origin: errai/errai

@Override
public void onItemsRemovedAt(List<M> oldList, List<Integer> indexes) {
 for (Integer index : indexes) {
  Widget widget = panel.getWidget(index);
  panel.remove(index);
  IOC.getAsyncBeanManager().destroyBean(getComponentFromWidget(widget));
 }
}

代码示例来源:origin: org.jboss.errai/errai-ui

@Override
public void onItemRemovedAt(List<M> oldList, int index) {
 Widget widget = panel.getWidget(index);
 panel.remove(index);
 IOC.getAsyncBeanManager().destroyBean(getComponentFromWidget(widget));
}

代码示例来源:origin: org.jboss.errai/errai-ui

@Override
public void onItemsRemovedAt(List<M> oldList, List<Integer> indexes) {
 for (Integer index : indexes) {
  Widget widget = panel.getWidget(index);
  panel.remove(index);
  IOC.getAsyncBeanManager().destroyBean(getComponentFromWidget(widget));
 }
}

代码示例来源:origin: errai/errai

@Override
 public void run() {
  IOC.getAsyncBeanManager().lookupBean(AirDependentBean.class)
    .getInstance(new CreationalCallback<AirDependentBean>() {
     @Override
     public void callback(AirDependentBean beanInstance) {
      assertNotNull(beanInstance);
      assertNotNull(beanInstance.getAir());
      finishTest();
     }
    });
 }
});

代码示例来源:origin: errai/errai

@Override
 public void run() {
  IOC.getAsyncBeanManager().lookupBean(UnreferencedDependentRootBean.class)
    .getInstance(new CreationalCallback<UnreferencedDependentRootBean>() {
     @Override
     public void callback(final UnreferencedDependentRootBean applicationScopedBean) {
      assertNotNull("UnreferencedDependentRootBean was null", applicationScopedBean);
      assertNotNull("Dependent injection was null", applicationScopedBean.getBeanB());
      finishTest();
     }
    });
 }
});

代码示例来源:origin: errai/errai

public void testBeanManagerInjectable() {
 final BeanManagerDependentBean bean = IOC.getBeanManager().lookupBean(BeanManagerDependentBean.class)
     .getInstance();
 final ClientBeanManager beanManager = (GWT.<IOCEnvironment>create(IOCEnvironment.class).isAsync() ? IOC.getAsyncBeanManager() : IOC.getBeanManager());
 assertSame(beanManager, Factory.maybeUnwrapProxy(bean.getBeanManager()));
}

相关文章