Refine search
/** * JAX-RS resource used to reload the first application. * This resource is only registered inside the second application. * * @author Jakub Podlesak (jakub.podlesak at oracle.com) */ @Stateless @Path("reload") public class ReloaderResource { @EJB EjbReloaderService ejbReloaderService; @GET public void reloadTheOtherApp() { ejbReloaderService.reload(); } }
/** * This is a CDI bean delegating to a SLSB from the same deployment * * @author Daniel Meyer * */ @Named("SLSBClientDelegate") public class SLSBClientDelegate implements JavaDelegate { @EJB private JavaDelegate bean; public void execute(DelegateExecution execution) throws Exception { bean.execute(execution); } }
@Named @Stateless public class BeanValidationServiceBean { @EJB DatasetServiceBean datasetService; @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) public void validateDatasets() { for (Dataset dataset : datasetService.findAll()) { for (DatasetVersion version : dataset.getVersions()) { for (FileMetadata fileMetadata : version.getFileMetadatas()) { } } } } }
/** * * @author Daniel Meyer * */ @Named public class InvocationCounterDelegateBeanLocal implements JavaDelegate { @EJB(lookup="java:global/" + "service/" + "InvocationCounterServiceBean!org.camunda.bpm.integrationtest.functional.ejb.request.beans.InvocationCounterServiceLocal") private InvocationCounterServiceLocal invocationCounterService; public void execute(DelegateExecution execution) throws Exception { execution.setVariable("invocationCounter", invocationCounterService.getNumOfInvocations()); } }
@Stateless @Named public class RepositoryStorageAbstractionLayerPage { private static final Logger logger = Logger.getLogger(RepositoryStorageAbstractionLayerPage.class.getCanonicalName()); @EJB SettingsServiceBean settingsService; @EJB StorageSiteServiceBean storageSiteServiceBean; public String getLocalDataAccessDirectory(DatasetVersion datasetVersion) { String localDataAccessParentDir = settingsService.getValueForKey(SettingsServiceBean.Key.LocalDataAccessPath); return RepositoryStorageAbstractionLayerUtil.getLocalDataAccessDirectory(localDataAccessParentDir, datasetVersion.getDataset()); } public List<RsyncSite> getRsyncSites(DatasetVersion datasetVersion) { List<StorageSite> storageSites = storageSiteServiceBean.findAll(); JsonArray storageSitesAsJson = RepositoryStorageAbstractionLayerUtil.getStorageSitesAsJson(storageSites); return RepositoryStorageAbstractionLayerUtil.getRsyncSites(datasetVersion.getDataset(), storageSitesAsJson); } public String getVerifyDataCommand(DatasetVersion datasetVersion) { return RepositoryStorageAbstractionLayerUtil.getVerifyDataCommand(datasetVersion.getDataset()); } }
/** * JAX-RS resource backed by a stateless EJB bean. * * @author Jakub Podlesak (jakub.podlesak at oracle.com) */ @Stateless @Path("stateless") public class StatelessResource { @EJB EjbCounterResource counter; @Context UriInfo uriInfo; @GET public int getCount() { return counter.getCount(); } @GET @Path("{uriInfo}") public String getPath() { return uriInfo != null ? uriInfo.getPath() : "uri info is null"; } }
/** * This is a CDI bean delegating to a SingletonBeanClientDelegate from the same deployment * * @author Daniel Meyer * */ @Named("SingletonBeanClientDelegate") public class SingletonBeanClientDelegate implements JavaDelegate { @EJB private JavaDelegate bean; public void execute(DelegateExecution execution) throws Exception { bean.execute(execution); } }
/** * Conformance Rest Service * * @author Peter Van Houte */ // START SNIPPET: jax-rs-conformance @Path("") @Stateless @Produces({ MediaType.APPLICATION_JSON, Constants.CT_FHIR_JSON, Constants.CT_FHIR_XML }) public class JaxRsConformanceProvider extends AbstractJaxRsConformanceProvider { @EJB private JaxRsPatientRestProvider provider; public JaxRsConformanceProvider() { super("My Server Description", "My Server Name", "My Server Version"); } @Override protected ConcurrentHashMap<Class<? extends IResourceProvider>, IResourceProvider> getProviders() { ConcurrentHashMap<Class<? extends IResourceProvider>, IResourceProvider> map = new ConcurrentHashMap<Class<? extends IResourceProvider>, IResourceProvider>(); map.put(JaxRsConformanceProvider.class, this); map.put(JaxRsPatientRestProvider.class, provider); return map; } } // END SNIPPET: jax-rs-conformance
/** * This is a CDI bean delegating to a SFSB from the same deployment * * @author Daniel Meyer * */ @Named("SFSBClientDelegate") public class SFSBClientDelegate implements JavaDelegate { @EJB private JavaDelegate bean; public void execute(DelegateExecution execution) throws Exception { bean.execute(execution); } }
@Stateless(name="ProcessApplicationService", mappedName="ProcessApplicationService") @Local(ProcessApplicationService.class) @TransactionAttribute(TransactionAttributeType.SUPPORTS) public class EjbProcessApplicationService implements ProcessApplicationService { @EJB protected EjbBpmPlatformBootstrap ejbBpmPlatform;
/** * A CDI bean delegating to the local business * interface of a SLSB from a different application. * * @author Daniel Meyer * */ @Named public class LocalSLSBClientDelegateBean implements JavaDelegate { @EJB(lookup="java:global/service/LocalSLSBean!org.camunda.bpm.integrationtest.functional.ejb.local.bean.BusinessInterface") private BusinessInterface businessInterface; @Override public void execute(DelegateExecution execution) throws Exception { execution.setVariable("result", businessInterface.doBusiness()); } }
/** * A CDI bean delegating to the local business * interface of a Singleton Bean from a different application. * * @author Daniel Meyer * */ @Named public class LocalSingletonBeanClientDelegateBean implements JavaDelegate { @EJB(lookup="java:global/service/LocalSingletonBean!org.camunda.bpm.integrationtest.functional.ejb.local.bean.BusinessInterface") private BusinessInterface businessInterface; @Override public void execute(DelegateExecution execution) throws Exception { execution.setVariable("result", businessInterface.doBusiness()); } }
@Stateless @EJB(name = "java:global/test/IdentityServiceBean", beanInterface = IdentityService.class) public class IdentityServiceBean implements IdentityService { private static final Log LOG = LogFactory.getLog(IdentityServiceBean.class); public IdentityRequest getIdentityRequest() { LOG.debug("getIdentityRequest"); IdentityRequest identityRequest = new IdentityRequest(true, true, true, true, true); return identityRequest; } }
/** * A CDI bean delegating to the local business * interface of a SLSB from a different application. * * @author Daniel Meyer * */ @Named public class InvokeStartProcessDelegateSLSB implements JavaDelegate { @EJB(lookup="java:global/service/StartProcessSLSB!org.camunda.bpm.integrationtest.functional.ejb.local.bean.StartProcessInterface") private StartProcessInterface businessInterface; @Override public void execute(DelegateExecution execution) throws Exception { execution.setVariable("result", businessInterface.doStartProcess()); } }
@Stateless @EJB(name = "java:global/test/AuthenticationRevokeServiceBean", beanInterface = AuthenticationRevokeService.class) public class AuthenticationRevokeServiceBean implements AuthenticationRevokeService { private static final Log LOG = LogFactory.getLog(AuthenticationRevokeServiceBean.class); public void validateCertificateChain(List<X509Certificate> certificateChain) throws SecurityException { LOG.debug("validate certificate chain: " + certificateChain); throw new RevokedCertificateSecurityException(); } }
/** * A CDI bean delegating to the local business * interface of a SFSB from a different application. * * @author Daniel Meyer * */ @Named public class LocalSFSBClientDelegateBean implements JavaDelegate { @EJB(lookup="java:global/service/LocalSFSBean!org.camunda.bpm.integrationtest.functional.ejb.local.bean.BusinessInterface") private BusinessInterface businessInterface; @Override public void execute(DelegateExecution execution) throws Exception { execution.setVariable("result", businessInterface.doBusiness()); } }
@Stateless @EJB(name = "java:global/test/InsecureClientEnvironmentBean", beanInterface = InsecureClientEnvironment.class) public class InsecureClientEnvironmentBean implements InsecureClientEnvironment { private static final Log LOG = LogFactory.getLog(InsecureClientEnvironmentBean.class); public void checkSecureClientEnvironment(String javaVersion, String javaVendor, String osName, String osArch, String osVersion, String userAgent, String navigatorAppName, String navigatorAppVersion, String navigatorUserAgent, String remoteAddress, Integer sslKeySize, String sslCipherSuite, List<String> readerList) throws InsecureClientEnvironmentException { LOG.debug("checking secure client environment"); throw new InsecureClientEnvironmentException(); } }