本文整理了Java中javax.ejb.Stateless
类的一些代码示例,展示了Stateless
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stateless
类的具体详情如下:
包路径:javax.ejb.Stateless
类名称:Stateless
暂无
代码示例来源:origin: javaee-samples/javaee7-samples
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class SimpleGreeting implements Greeting {
@Inject
HttpServletRequest httpServletRequest;
@Inject
HttpSession httpSession;
@Inject
ServletContext servletContext;
代码示例来源:origin: NationalSecurityAgency/datawave
@Path("/EdgeDictionary")
@GZIP
@Produces({"application/xml", "text/xml", "application/json", "text/yaml", "text/x-yaml", "application/x-yaml", "application/x-protobuf",
"application/x-protostuff", "text/html"})
@LocalBean
@Stateless
@PermitAll
public class EdgeDictionaryBean {
@Resource
private EJBContext ctx;
@Inject
private AccumuloConnectionFactory connectionFactory;
@Inject
private DatawaveEdgeDictionary datawaveEdgeDictionary;
@Inject
@SpringBean(refreshable = true)
private EdgeDictionaryConfiguration edgeDictionaryConfiguration;
代码示例来源:origin: jamesagnew/hapi-fhir
/**
* 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
代码示例来源:origin: remibantos/jeeshop
@Path("fees")
@Stateless
public class Fees {
@Inject
private OrderConfiguration orderConfiguration;
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Named
@Stateless
public class Delta {
@SuppressWarnings("unused")
@Inject
@New
private Alpha alpha;
public void foo() {
}
}
代码示例来源:origin: jamesagnew/hapi-fhir
@Stateless
@Path("/Patient")
@Produces({ MediaType.APPLICATION_JSON, Constants.CT_FHIR_JSON, Constants.CT_FHIR_XML })
public class JaxRsPatientRestProvider extends AbstractJaxRsResourceProvider<Patient> {
代码示例来源:origin: IQSS/dataverse
@Stateless
@Named
public class TemplateServiceBean {
@EJB
IndexServiceBean indexService;
@PersistenceContext(unitName = "VDCNet-ejbPU")
private EntityManager em;
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class GiraffeService {
@Inject
private Event<Giraffe> event;
@Resource
private UserTransaction userTransaction;
public void feed() throws Exception {
userTransaction.begin();
event.fire(new Giraffe());
ActionSequence.addAction("checkpoint");
userTransaction.commit();
}
}
代码示例来源:origin: jersey/jersey
/**
* 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();
}
}
代码示例来源:origin: NationalSecurityAgency/datawave
@Path("/Accumulo")
@RolesAllowed({"InternalUser", "Administrator"})
@DeclareRoles({"InternalUser", "Administrator"})
@LocalBean
@Stateless
@TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
@TransactionManagement(TransactionManagementType.BEAN)
public class ListUsersBean {
@EJB
private AccumuloConnectionFactory connectionFactory;
代码示例来源:origin: IQSS/dataverse
/**
*
* @author skraffmiller
*/
@Stateless
@Named
public class ControlledVocabularyValueServiceBean implements java.io.Serializable {
@PersistenceContext(unitName = "VDCNet-ejbPU")
private EntityManager em;
public List<ControlledVocabularyValue> findByDatasetFieldTypeId(Long dsftId) {
String queryString = "select o from ControlledVocabularyValue as o where o.datasetFieldType.id = " + dsftId + " ";
TypedQuery<ControlledVocabularyValue> query = em.createQuery(queryString, ControlledVocabularyValue.class);
return query.getResultList();
}
}
代码示例来源:origin: IQSS/dataverse
@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()) {
}
}
}
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Arun Gupta
*/
@Path("employee")
@Stateless
public class EmployeeResource {
@PersistenceContext
EntityManager em;
@GET
@Produces("application/xml")
public Employee[] get() {
return em.createNamedQuery("Employee.findAll", Employee.class).getResultList().toArray(new Employee[0]);
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
/**
* @author Arun Gupta
*/
@Stateless
public class TestBean {
@Resource(name = "DefaultManagedExecutorService")
ManagedExecutorService executor;
public boolean doSomething() throws InterruptedException {
TestStatus.latch = new CountDownLatch(1);
executor.submit(new Runnable() {
@Override
public void run() {
TestStatus.latch.countDown();
}
});
TestStatus.latch.await(2000, TimeUnit.MILLISECONDS);
return true;
}
}
代码示例来源:origin: org.rhq/rhq-enterprise-server
@Stateless
public class MeasurementProblemManagerBean implements MeasurementProblemManagerLocal, MeasurementProblemManagerRemote {
@SuppressWarnings("unused")
private final Log log = LogFactory.getLog(MeasurementProblemManagerBean.class);
@PersistenceContext(unitName = RHQConstants.PERSISTENCE_UNIT_NAME)
private EntityManager entityManager;
@EJB
private AuthorizationManagerLocal authorizationManager;
代码示例来源:origin: ops4j/org.ops4j.pax.exam2
@Stateless
public class ActorService {
@PersistenceContext
private EntityManager em;
public Actor findById(int id) {
Actor actor = em.find(Actor.class, id);
actor.getRoles();
return actor;
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Stateless
@Local(ExecutorService.class)
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class ExecutorServiceBean implements ExecutorService {
@Resource(mappedName="eis/JcaExecutorServiceConnectionFactory")
protected JcaExecutorServiceConnectionFactory executorConnectionFactory;
代码示例来源:origin: camunda/camunda-bpm-platform
@Stateless(name="ProcessApplicationService", mappedName="ProcessApplicationService")
@Local(ProcessApplicationService.class)
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class EjbProcessApplicationService implements ProcessApplicationService {
@EJB
protected EjbBpmPlatformBootstrap ejbBpmPlatform;
代码示例来源:origin: be.fedict.eid-applet/eid-applet-test-model
@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;
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
@Stateless
public class EJBBean {
public String getText() {
return "Called from EJB";
}
}
内容来源于网络,如有侵权,请联系作者删除!