本文整理了Java中javax.ejb.Stateless.<init>()
方法的一些代码示例,展示了Stateless.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stateless.<init>()
方法的具体详情如下:
包路径:javax.ejb.Stateless
类名称:Stateless
方法名:<init>
暂无
代码示例来源: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: 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
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class SimpleGreeting implements Greeting {
@Inject
HttpServletRequest httpServletRequest;
@Inject
HttpSession httpSession;
@Inject
ServletContext servletContext;
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Stateless
public class Baz {
@EJB
Bar bar;
@Inject
Qux qux;
public Bar getBar() {
return bar;
}
public Qux getQux() {
return qux;
}
public int ping(int base) {
return bar.ping(++base);
}
}
代码示例来源:origin: EvoSuite/evosuite
@Stateless
@TransactionManagement(TransactionManagementType.BEAN)
public class ManagedComponent {
@PersistenceContext
private EntityManager entityManager;
@Inject
private UserTransaction userTransaction;
@Inject
private UnManagedComponent helper;
代码示例来源:origin: camunda/camunda-bpm-platform
@Stateless
@Remote(InvocationCounterService.class)
@Local(InvocationCounterServiceLocal.class)
public class InvocationCounterServiceBean implements InvocationCounterService, InvocationCounterServiceLocal {
@Inject
private InvocationCounter invocationCounter;
public int getNumOfInvocations() {
return invocationCounter.incrementAndGet();
}
}
代码示例来源: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: jersey/jersey
/**
* 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";
}
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Stateless
public class Yoghurt {
@Inject
private Bean<Yoghurt> bean;
public Bean<Yoghurt> getBeanBean() {
return bean;
}
@Frozen
public YoghurtInterceptor getInterceptorInstance() {
return null;
}
}
代码示例来源:origin: algaworks/curso-jpa-hibernate
@Stateless
public class CadastroClienteEJB {
@PersistenceContext(unitName="projetoGlassfishPU")
private EntityManager em;
public void salvar(Cliente cliente) {
em.persist(cliente);
}
@SuppressWarnings("unchecked")
public List<Cliente> buscarTodos() {
return em.createQuery("from Cliente c").getResultList();
}
}
代码示例来源: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: org.jboss.cdi.tck/cdi-tck-impl
@Stateless
public class Bar {
@Inject
Foo foo;
public Foo getFoo() {
return foo;
}
public int ping(int base) {
return foo.ping(++base);
}
}
代码示例来源:origin: org.jboss.teiid.extensions/database-service
@Stateless(name="teiid-database-service")
public class DatabaseServiceBean implements DatabaseServiceLocal {
@PersistenceContext
private EntityManager em;
public void log(CommandLogMessage msg) {
CommandEnitity entity = new CommandEnitity(msg);
em.persist(entity);
}
public void log(AuditMessage msg) {
AuditEnitity entity = new AuditEnitity(msg);
em.persist(entity);
}
}
代码示例来源: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: org.jboss.cdi.tck/cdi-tck-impl
/**
* Injects bar from bean archive - EAR lib.
*/
@Stateless
public class Baz {
@Inject
private Bar bar;
public int ping() {
return bar.ping();
}
}
代码示例来源:origin: IQSS/dataverse
/**
*
* @author ellenk
*/
@Stateless
public class CustomFieldServiceBean {
@PersistenceContext(unitName = "VDCNet-ejbPU")
private EntityManager em;
public CustomFieldMap findByTemplateField(String template, String field) {
try {
CustomFieldMap map = (CustomFieldMap) em.createNamedQuery("CustomFieldMap.findByTemplateField").setParameter("template", template).setParameter("field", field).getSingleResult();
return map;
} catch (Exception ex) {
System.out.println("Exception "+ ex + "template: "+template+" field: "+ field);
return null;
}
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
@Stateless(name="ProcessEngineService", mappedName="ProcessEngineService")
@Local(ProcessEngineService.class)
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class EjbProcessEngineService implements ProcessEngineService {
@EJB
protected EjbBpmPlatformBootstrap ejbBpmPlatform;
代码示例来源:origin: astefanutti/metrics-cdi
@Stateless
public class TimedMethodScheduledBean {
@Inject
private CallCounter counter;
@Timed(name = "schedule")
@Schedule(hour = "*", minute = "*", second = "*", persistent = false)
public void scheduledMethod() {
counter.count();
}
}
代码示例来源:origin: hopshadoop/hopsworks
@Stateless
public class MetaLogFacade extends AbstractFacade<MetaLog> {
private static final Logger logger = Logger.getLogger(MetaLogFacade.class.
getName());
@PersistenceContext(unitName = "kthfsPU")
private EntityManager em;
public MetaLogFacade() {
super(MetaLog.class);
}
@Override
protected EntityManager getEntityManager() {
return em;
}
public void persist(MetaLog metaLog) {
em.persist(metaLog);
}
}
代码示例来源: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!