Codota Logo
BeanManager.fireEvent
Code IndexAdd Codota to your IDE (free)

How to use
fireEvent
method
in
javax.enterprise.inject.spi.BeanManager

Best Java code snippets using javax.enterprise.inject.spi.BeanManager.fireEvent (Showing top 20 results out of 603)

  • Common ways to obtain BeanManager
private void myMethod () {
BeanManager b =
  • Codota IconCDI.current().getBeanManager()
  • Codota IconBeanManagerProvider.getInstance().getBeanManager()
  • Codota IconWeldContainer container;container.getBeanManager()
  • Smart code suggestions by Codota
}
origin: stackoverflow.com

 public class MenuChangeListener {

  // Outcommented because it's broken in current GF/WF versions.
  // @Inject
  // private Event<MenuChangeEvent> event;

  @Inject
  private BeanManager beanManager;

  @PostPersist
  @PostUpdate
  @PostRemove
  public void onChange(Menu menu) {
    // Outcommented because it's broken in current GF/WF versions.
    // event.fire(new MenuChangeEvent(menu));

    beanManager.fireEvent(new MenuChangeEvent(menu));
  }

}
origin: camunda/camunda-bpm-platform

public void notify(DelegateExecution execution) throws Exception {
 // test whether cdi is setup correctly. (if not, just do not deliver the event)
 if (!testCdiSetup()) {
  return;
 }
 BusinessProcessEvent event = createEvent(execution);
 Annotation[] qualifiers = getQualifiers(event);
 getBeanManager().fireEvent(event, qualifiers);
}
origin: camunda/camunda-bpm-platform

public void notify(DelegateTask task) {
 // test whether cdi is setup correctly. (if not, just do not deliver the event)
 if (!testCdiSetup()) {
  return;
 }
 BusinessProcessEvent event = createEvent(task);
 Annotation[] qualifiers = getQualifiers(event);
 getBeanManager().fireEvent(event, qualifiers);
}
origin: com.caucho/resin

@Override
public void fire(T event)
{
 _manager.fireEvent(event, _bindings);
}
origin: com.vaadin/vaadin-cdi

private void fireCdiDestroyEvent(ServiceDestroyEvent event) {
  try {
    beanManager.fireEvent(event);
  } catch (Exception e) {
    // During application shutdown on TomEE 7,
    // beans are lost at this point.
    // Does not throw an exception, but catch anything just to be sure.
    getLogger().warn("Error at destroy event distribution with CDI.",
        e);
  }
}
origin: org.apache.myfaces.extensions.cdi.modules/myfaces-extcdi-jsf12-module-impl

private void fireRestartConversationEvent()
{
  if(this.restartConversationEventEnable)
  {
    this.beanManager.fireEvent(new RestartConversationEvent(this));
  }
}
origin: org.apache.myfaces.extensions.cdi.modules/myfaces-extcdi-jsf12-module-impl

private void fireCloseConversationEvent()
{
  if(this.closeConversationEventEnable)
  {
    this.beanManager.fireEvent(new CloseConversationEvent(this));
  }
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Test(groups = { "events" }, expectedExceptions = { TeaCupPomeranian.OversizedException.class })
@SpecAssertion(section = "10.5", id = "cc")
public void testNonTransactionalObserverThrowsNonCheckedExceptionIsRethrown()
{
 getCurrentManager().fireEvent("string event");
}
origin: org.apache.geronimo/geronimo-metrics

void letOtherExtensionsUseRegistries(@Observes final BeforeBeanDiscovery beforeBeanDiscovery, final BeanManager beanManager) {
  beforeBeanDiscovery.addQualifier(RegistryType.class);
  beanManager.fireEvent(applicationRegistry);
  beanManager.fireEvent(applicationRegistry, new RegistryTypeImpl(MetricRegistry.Type.APPLICATION));
  beanManager.fireEvent(baseRegistry, new RegistryTypeImpl(MetricRegistry.Type.BASE));
  beanManager.fireEvent(vendorRegistry, new RegistryTypeImpl(MetricRegistry.Type.VENDOR));
  // we make @Metric.name binding (to avoid to write producers relying on injection point)
  beforeBeanDiscovery.configureQualifier(org.eclipse.microprofile.metrics.annotation.Metric.class)
      .methods().stream().filter(method -> method.getAnnotated().getJavaMember().getName().equals("name"))
      .forEach(method -> method.remove(a -> a.annotationType() == Nonbinding.class));
}
origin: org.jboss.forge/forge-shell-api

private void fireResourceCreated()
{
 if (resourceFactory != null)
 {
   BeanManager manager = resourceFactory.getManagerInstance();
   if (manager != null)
   {
    manager.fireEvent(new ResourceCreated(this));
   }
 }
}
origin: org.jboss.forge/forge-shell-api

private void fireResourceModified()
{
 if (resourceFactory != null)
 {
   BeanManager manager = resourceFactory.getManagerInstance();
   if (manager != null)
   {
    manager.fireEvent(new ResourceModified(this));
   }
 }
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Test(groups = { "events", "inheritance" })
@SpecAssertion(section = "4.2", id = "df")
public void testNonStaticObserverMethodInherited() throws Exception
{
 Egg egg = new Egg();
 getCurrentManager().fireEvent(egg);
 assert egg.getVisited().size() == 2;
 assert egg.getVisited().contains(Farmer.class.getSimpleName());
 assert egg.getVisited().contains(LazyFarmer.class.getSimpleName());
}

origin: org.jboss.cdi.tck/cdi-tck-impl

@Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
@SpecAssertion(section = MEMBER_LEVEL_INHERITANCE, id = "g")
public void testObserver(Foo foo) throws Exception {
  assertNotNull(foo);
  getCurrentManager().fireEvent(new Qux(null));
  assertNotNull(foo.getT1BazEvent());
  assertEquals(foo.getT1ObserverInjectionPoint(), "ok");
}
origin: caelum/vraptor4

public void configure(@Observes VRaptorInitialized event){
  for (Bean<?> bean : beanManager.getBeans(Object.class)) {
    Annotation qualifier = tryToFindAStereotypeQualifier(bean);
    if (qualifier != null) {
      beanManager.fireEvent(new DefaultBeanClass(bean.getBeanClass()), qualifier);
    }
  }
  interceptorsCache.init();
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = OBSERVES, id = "a")
public void testPrivateObserverMethodInvoked() {
  PrivateObserver.reset();
  getCurrentManager().fireEvent(new Delivery());
  assertTrue(PrivateObserver.isObserved);
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = DEPENDENT_OBJECTS, id = "i")
@SpecAssertion(section = DEPENDENT_DESTRUCTION, id = "ccd")
public void testInstanceDependentObject() {
  Foo.reset();
  getCurrentManager().fireEvent(new GoodEvent());
  assertTrue(Foo.created);
  assertTrue(Foo.destroyed);
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "be") })
public void testDecoratorIsNotApplied() {
  Foo payload = new Foo(false);
  manager.fireEvent(payload);
  assertTrue(fooObserver.isObserved());
  assertFalse(payload.isDecorated());
  assertTrue(manager.isQualifier(Default.class)); // not decorated
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertions({ @SpecAssertion(section = OBSERVER_ORDERING, id = "b") })
public void testPrioritizedEventBaseclass() {
  ActionSequence.reset();
  getCurrentManager().fireEvent(new MoonActivity());
  assertEquals(ActionSequence.getSequenceSize(), 2);
  // APPLICATION, APPLICATION + 900
  ActionSequence.assertSequenceDataEquals(MoonObservers.Observer1.class.getName(),
      MoonObservers.Observer3.class.getName());
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertions({ @SpecAssertion(section = INIT_EVENTS, id = "d"), @SpecAssertion(section = INIT_EVENTS, id = "f"),
    @SpecAssertion(section = INIT_EVENTS, id = "bb") })
public void testContainerDeliversEventNotifications() {
  assertTrue(simpleBean.getSimpleExtension().isContainerEventObserved());
  getCurrentManager().fireEvent(new SimpleEvent(System.currentTimeMillis()));
  assertTrue(simpleBean.getSimpleExtension().isSimpleEventObserved());
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Test(groups="rewrite")
@SpecAssertions({
 @SpecAssertion(section = "11.5.2", id = "a"),
 @SpecAssertion(section = "11.5.3", id = "a"),
 @SpecAssertion(section = "12.2", id = "g")
})
public void testDeployedManagerEvent()
{
 assert ManagerObserver.isAfterDeploymentValidationCalled();
 // Make sure the manager does accept requests now
 getCurrentManager().fireEvent("event");
}
javax.enterprise.inject.spiBeanManagerfireEvent

Javadoc

Fire an event and notify observers.

This method is deprecated from CDI 2.0 and #getEvent()) should be used instead.

Popular methods of BeanManager

  • createCreationalContext
    Obtain an instance of a javax.enterprise.context.spi.CreationalContext for the given javax.enterpris
  • getBeans
    Return the set of beans which have the given required type and qualifiers and are available for inje
  • getReference
    Obtains a contextual reference for a certain Bean and a certain bean type of the bean.
  • resolve
    Apply the ambiguous dependency resolution rules to a set of Bean. Note that when called during invoc
  • createAnnotatedType
    Obtain an AnnotatedType that may be used to read the annotations of the given class or interface.
  • createInjectionTarget
    Obtains an InjectionTarget for the given AnnotatedType. The container ignores the annotations and t
  • getContext
    Obtains an active javax.enterprise.context.spi.Context for the given javax.enterprise.context .
  • isNormalScope
    Test the given annotation type to determine if it is a javax.enterprise.context.
  • isQualifier
    Test the given annotation type to determine if it is a javax.inject.Qualifier.
  • isStereotype
    Test the given annotation type to determine if it is a javax.enterprise.inject.Stereotype.
  • getInjectableReference
    Obtains an injectable reference for a certain InjectionPoint.
  • getELResolver
    Returns a javax.el.ELResolver that resolves beans by EL name.
  • getInjectableReference,
  • getELResolver,
  • isScope,
  • getPassivationCapableBean,
  • getInjectionTargetFactory,
  • getStereotypeDefinition,
  • wrapExpressionFactory,
  • getExtension,
  • isInterceptorBinding

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • LinkedHashMap (java.util)
    Hash table and linked list implementation of the Map interface, with predictable iteration order. Th
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now