Tabnine Logo
Activate
Code IndexAdd Tabnine to your IDE (free)

How to use
Activate
in
org.kie.internal.runtime.cdi

Best Java code snippets using org.kie.internal.runtime.cdi.Activate (Showing top 2 results out of 315)

origin: org.jbpm/jbpm-executor-cdi

/**
 * Dedicated <code>WorkItemHandlerProducer</code> to register <code>AsyncWorkItemHandler</code>
 * in CDI environment when using deployment services (jbpm-kie-services).
 *
 */
@Activate(whenAvailable="org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl")
@ApplicationScoped
public class AsyncHandlerProducer implements WorkItemHandlerProducer {

  @Override
  public Map<String, WorkItemHandler> getWorkItemHandlers(String identifier, Map<String, Object> params) {
    Map<String, WorkItemHandler> handlers = new HashMap<String, WorkItemHandler>();
    ExecutorService executorService = (ExecutorService) params.get("executorService");
    if (executorService != null) {
      handlers.put("async",new AsyncWorkItemHandler(executorService, PrintOutCommand.class.getName()));
    }
    
    return handlers;
  }

}

origin: kiegroup/droolsjbpm-knowledge

<X> void processAnnotatedType(@Observes final @WithAnnotations(Activate.class) ProcessAnnotatedType<X> pat) {
  final AnnotatedType<X> annotatedType = pat.getAnnotatedType();
  final Class<X> javaClass = annotatedType.getJavaClass();
  Activate veto = javaClass.getAnnotation(Activate.class);
  String whenAvailable = veto.whenAvailable();
  String whenNotAvailable = veto.whenNotAvailable();
  if (isNotEmpty(whenAvailable) && !isAvailable(whenAvailable, true)) {
    // veto bean in case whenAvailable is not present
    pat.veto();
  }
  if (isNotEmpty(whenNotAvailable) && isAvailable(whenNotAvailable, false)) {
    // veto bean in case whenNotAvailable is present
    pat.veto();
  }
}
org.kie.internal.runtime.cdiActivate

Most used methods

  • <init>
  • whenAvailable
  • whenNotAvailable

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • getApplicationContext (Context)
  • putExtra (Intent)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 17 PhpStorm Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now