本文整理了Java中javax.ejb.Stateful
类的一些代码示例,展示了Stateful
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stateful
类的具体详情如下:
包路径:javax.ejb.Stateful
类名称:Stateful
暂无
代码示例来源:origin: hibernate/hibernate-orm
@Stateful
@TransactionManagement(TransactionManagementType.BEAN)
public class BmtEmfStatefulBean {
EntityManagerFactory emf;
@Inject
UserTransaction utx;
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
@Stateful
@SessionScoped
public class Espoo_Broken implements EspooLocal_Broken
{
@Inject
District district;
@Remove
public void bye() {
}
}
代码示例来源:origin: camunda/camunda-bpm-platform
/**
* A request scoped Stateful Session Bean acting as as a JavaDelegate
*
* @author Daniel Meyer
*
*/
@Named
@Stateful
@RequestScoped
public class RequestScopedSFSBDelegate implements JavaDelegate {
private int invocationCounter = 0;
public void execute(DelegateExecution execution) throws Exception {
invocationCounter++;
execution.setVariable("invocationCounter", invocationCounter);
}
}
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
@SessionScoped
@Stateful
@Named("John")
public class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal
{
@Remove
public void bye()
{
}
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Stateful
@SessionScoped
public class SetterInjectionCorralBroken extends Corral {
private Cow cow;
@Inject
public void setCow(@British Cow cow){
this.cow = cow;
}
public void ping(){
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
@Stateful
public class CartBean {
代码示例来源:origin: org.glassfish.ejb/ejb-container
/**
* Return the name attribute of given annotation.
* @param annotation
* @return name
*/
protected String getAnnotatedName(Annotation annotation) {
Stateful sfAn = (Stateful)annotation;
return sfAn.name();
}
代码示例来源:origin: org.jboss/jboss-metadata
protected SessionBeanMetaData create(Class<?> beanClass, Stateful annotation)
{
return create(beanClass, annotation.name(), annotation.mappedName(), annotation.description());
}
}
代码示例来源:origin: org.glassfish.main.ejb/ejb-container
doDescriptionProcessing(sful.description(), ejbDesc);
doMappedNameProcessing(sful.mappedName(), ejbDesc);
ejbSessionDesc.setPassivationCapable(sful.passivationCapable());
代码示例来源:origin: org.glassfish.ejb/ejb-container
/**
* Set Annotation information to Descriptor.
* This method will also be invoked for an existing descriptor with
* annotation as user may not specific a complete xml.
* @param ejbDesc
* @param ainfo
* @return HandlerProcessingResult
*/
protected HandlerProcessingResult setEjbDescriptorInfo(
EjbDescriptor ejbDesc, AnnotationInfo ainfo)
throws AnnotationProcessorException {
EjbSessionDescriptor ejbSessionDesc = (EjbSessionDescriptor)ejbDesc;
// set session bean type in case it wasn't set in a sparse ejb-jar.xml.
if( !ejbSessionDesc.isSessionTypeSet() ) {
ejbSessionDesc.setSessionType(EjbSessionDescriptor.STATEFUL);
}
Stateful sful = (Stateful) ainfo.getAnnotation();
doDescriptionProcessing(sful.description(), ejbDesc);
doMappedNameProcessing(sful.mappedName(), ejbDesc);
return setBusinessAndHomeInterfaces(ejbDesc, ainfo);
}
}
代码示例来源:origin: org.apache.geronimo.ext.openejb/openejb-core
if (stateful.mappedName() != null) {
sessionBean.setMappedName(stateful.mappedName());
代码示例来源:origin: org.apache.tomee/openejb-core
if (stateful.mappedName() != null) {
sessionBean.setMappedName(stateful.mappedName());
sessionBean.setPassivationCapable(stateful.passivationCapable());
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
@Stateful
@SessionScoped
public class Espoo_Broken implements EspooLocal_Broken
{
@Inject
District district;
@Remove
public void bye() {
}
}
代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl
@Named("plough")
@Stateful
public class FarmEquipment implements FarmEquipmentLocal
{
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@SuppressWarnings("serial")
@SessionScoped
@Stateful
@Named("John")
public class WrappedEnterpriseBean implements WrappedEnterpriseBeanLocal {
@Remove
public void bye() {
}
}
代码示例来源:origin: org.jboss.cdi.tck/cdi-tck-impl
@Stateful
@SessionScoped
public class Maarianhamina_Broken implements MaarianHaminaLocal_Broken {
@Remove
public void bye() {
}
}
代码示例来源:origin: javaee-samples/javaee7-samples
@Stateful
public class CartBeanWithInterface implements Cart {
代码示例来源:origin: org.glassfish.main.ejb/ejb-container
/**
* Return the name attribute of given annotation.
* @param annotation
* @return name
*/
protected String getAnnotatedName(Annotation annotation) {
Stateful sfAn = (Stateful)annotation;
return sfAn.name();
}
代码示例来源:origin: org.jboss.ws/jbossws-jboss510-metadata
protected SessionBeanMetaData create(Class<?> beanClass, Stateful annotation)
{
return create(beanClass, annotation.name(), annotation.mappedName(), annotation.description());
}
代码示例来源:origin: org.apache.openejb/openejb-core
if (stateful.mappedName() != null) {
sessionBean.setMappedName(stateful.mappedName());
内容来源于网络,如有侵权,请联系作者删除!