Refine search
/** * @author Christian Bauer */ @ApplicationScoped public class MonitorPresenters { @Inject Instance<MonitorView.Presenter> monitorPresenterInstance; public void onMonitorServiceRequest(@Observes MonitorService request) { monitorPresenterInstance.get().init( request.service ); } }
@ApplicationScoped @Named(TheMainNamedApplicationScopedBeanImpl.NAME) public class TheMainNamedApplicationScopedBeanImpl implements TheNamedApplicationScopedBean { public static final String NAME = "TheMainNamedApplicationScopedBeanImpl_name";
@Produces @Named @ApplicationScoped public HistoryService historyService() { return processEngine().getHistoryService(); }
@Named("securityNoopHandler") @ApplicationScoped public class NoopHandler { @Inject private ComponentServerConfiguration configuration; public void onConnect(@Observes final OnConnection onConnection) { onConnection.validated(); } public void onCommand(@Observes final OnCommand onCommand) { onCommand.validated(); } }
@Produces @ApplicationScoped public static INewUserBootstrapper provideNewUserBootstrapper() { return new INewUserBootstrapper() { @Override public void bootstrapUser(UserBean user, IStorage storage) throws StorageException { // Do nothing special. } }; }
/** * TODO: Is this injection/lifecycle behavior of CDI specified? The newly created * instances are dependent on the lifecycle of this application scoped instance. * * @author Christian Bauer */ @ApplicationScoped public class ControlPresenters { @Inject Instance<ControlView.Presenter> controlPresenterInstance; public void onActionInvocationRequest(@Observes InvokeAction request) { controlPresenterInstance.get().init( request.action, request.presetInputValues ); } }
@Produces @Named @ApplicationScoped public RuntimeService runtimeService() { return processEngine().getRuntimeService(); }
@Produces @ApplicationScoped public ServletContext getInstance(){ return this.context; } }
@ApplicationScoped @Named(TheAlternativeNamedApplicationScopedBeanImpl.NAME) public class TheAlternativeNamedApplicationScopedBeanImpl implements TheNamedApplicationScopedBean { public static final String NAME = "TheAlternativeNamedApplicationScopedBeanImpl_name";
/** * Test {@code ApplicationScoped} bean to be injected to the test resource, while another {@code RequestScoped} * bean being injected into this class. * * @author Adam Lindenthal (adam.lindenthal at oracle.com) */ @ApplicationScoped public class ApplicationScopedBean { /** Request scoped bean injected via CDI */ @Inject private SecondBean bean; /** JAX-RS {@code Context} injection of request {@code UriInfo} */ @Context private UriInfo uri; private String name = "ApplicationScopedBean"; public String getMessage() { return name + ":" + bean.getMessage(); } public String getUri() { return uri.getPath(); } }
@Produces @Named @ApplicationScoped public IdentityService identityService() { return processEngine().getIdentityService(); }
@Produces @ApplicationScoped StandaloneXMLParser standaloneXmlParser() { return this.parser; }
@Named @ApplicationScoped public class ExampleBean { protected boolean invoked; public void invoke() { this.invoked = true; } public boolean isInvoked() { return invoked; } public void setInvoked(boolean invoked) { this.invoked = invoked; } }
/** * CDI based JAX-RS interceptor that re-writes the original output * with request ID obtained from another CDI bean. * * @author Jakub Podlesak (jakub.podlesak at oracle.com) */ @ResponseBodyFromCdiBean @ApplicationScoped public class CustomInterceptor implements WriterInterceptor { // CDI injected proxy @Inject RequestScopedBean bean; @Override public void aroundWriteTo(WriterInterceptorContext context) throws IOException, WebApplicationException { final String requestId = bean.getRequestId(); context.getOutputStream().write(requestId.getBytes()); } }
@Produces @Named @ApplicationScoped public ManagementService managementService() { return processEngine().getManagementService(); }
@Produces @ApplicationScoped ModelControllerClient client() { return this.client; }
/** * @author Daniel Meyer * */ @Named @ApplicationScoped public class BpmnElementRetrievalDelegate implements JavaDelegate { private FlowElement bpmnModelElementInstance; private BpmnModelInstance bpmnModelInstance; @Override public void execute(DelegateExecution execution) throws Exception { bpmnModelElementInstance = execution.getBpmnModelElementInstance(); bpmnModelInstance = execution.getBpmnModelInstance(); } public FlowElement getBpmnModelElementInstance() { return bpmnModelElementInstance; } public BpmnModelInstance getBpmnModelInstance() { return bpmnModelInstance; } }
@ApplicationScoped public class LogPresenter implements LogView.Presenter { @Inject protected LogView view; @Inject protected Event<TextExpand> textExpandEvent;
@Produces @Named @ApplicationScoped public ExternalTaskService externalTaskService() { return processEngine().getExternalTaskService(); }
@Produces @ApplicationScoped StandaloneXMLParser standaloneXmlParser() { return this.parser; }