Java Code Examples for javax.enterprise.inject.spi.BeforeBeanDiscovery#addScope()

The following examples show how to use javax.enterprise.inject.spi.BeforeBeanDiscovery#addScope() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ViewScopedExtension.java    From deltaspike with Apache License 2.0 6 votes vote down vote up
/**
 * javax.faces.bean.ViewScoped is no CDI Scope.
 * We need to add it programmatically to CDI.
 */
public void addViewScoped(@Observes BeforeBeanDiscovery beforeBeanDiscovery)
{
    isActivated = ClassDeactivationUtils.isActivated(getClass());

    if (isActivated)
    {
        //this extension is only needed if the cdi-based view-scope handling isn't delegated to jsf 2.2+
        isActivated = !JsfUtils.isViewScopeDelegationEnabled();
    }

    if (!isActivated)
    {
        return;
    }

    beforeBeanDiscovery.addScope(ViewScoped.class, true, true);
}
 
Example 2
Source File: RefreshableScopeExtension.java    From datawave with Apache License 2.0 4 votes vote down vote up
@SuppressWarnings("unused")
void beforeBeanDiscovery(@Observes BeforeBeanDiscovery bbd, BeanManager bm) {
    bbd.addScope(RefreshableScope.class, true, false);
}
 
Example 3
Source File: ActivitiExtension.java    From activiti6-boot2 with Apache License 2.0 4 votes vote down vote up
public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event) {
  event.addScope(BusinessProcessScoped.class, true, true);
}
 
Example 4
Source File: FlowableExtension.java    From flowable-engine with Apache License 2.0 4 votes vote down vote up
public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event) {
    event.addScope(BusinessProcessScoped.class, true, true);
}
 
Example 5
Source File: BusinessScopeExtension.java    From drools-workshop with Apache License 2.0 4 votes vote down vote up
public void addACustomScope(@Observes final BeforeBeanDiscovery event) {
    event.addScope(BusinessScoped.class, true, false);
}
 
Example 6
Source File: ClientScopeExtension.java    From dolphin-platform with Apache License 2.0 4 votes vote down vote up
public void addScope(@Observes final BeforeBeanDiscovery event) {
    Assert.requireNonNull(event, "event");
    event.addScope(ClientScoped.class, true, false);
}
 
Example 7
Source File: RegisterJoynrJeeMessageContextExtension.java    From joynr with Apache License 2.0 4 votes vote down vote up
public void beforeBeanDiscovery(@Observes BeforeBeanDiscovery event) {
    logger.info("Adding JoynrJeeMessageScoped scope to event {}", event);
    event.addScope(JoynrJeeMessageScoped.class, true, false);
}
 
Example 8
Source File: ProcessEngineExtension.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public void beforeBeanDiscovery(@Observes final BeforeBeanDiscovery event, BeanManager manager) {
  event.addScope(BusinessProcessScoped.class, true, true);
  
  BeanManagerLookup.localInstance = manager;
}