javax.ejb.Stateful.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中javax.ejb.Stateful.<init>()方法的一些代码示例,展示了Stateful.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Stateful.<init>()方法的具体详情如下:
包路径:javax.ejb.Stateful
类名称:Stateful
方法名:<init>

Stateful.<init>介绍

暂无

代码示例

代码示例来源:origin: javaee-samples/javaee7-samples

@Stateful
public class CartBean {

代码示例来源:origin: javaee-samples/javaee7-samples

@Stateful
public class CartBeanWithInterface implements Cart {

代码示例来源:origin: javaee-samples/javaee7-samples

/**
 * 
 * @author Arjan Tijms
 * 
 */
@Stateful
public class ReentrantStatefulBean {

  @Resource
  private SessionContext sessionConext;

  public void initialMethod() {
    sessionConext.getBusinessObject(ReentrantStatefulBean.class).reentrantMehthod();
  }

  public void reentrantMehthod() {

  }

}

代码示例来源:origin: jersey/jersey

/**
 * JAX-RS resource backed with a stateful EJB bean.
 *
 * @author Jakub Podlesak (jakub.podlesak at oracle.com)
 */
@Stateful
@Path("stateful")
public class StatefulResource {

  @EJB EjbCounterResource counter;

  @GET
  @Path("count")
  public int getCount() {
    return counter.getCount();
  }
}

代码示例来源:origin: javaee-samples/javaee7-samples

@Stateful
public class MyStatefulBean {
  private List<String> list;

代码示例来源:origin: hibernate/hibernate-orm

/**
 * Arquillian "component" for testing auto-ddl execution when initiated by the "app"
 *
 * @author Steve Ebersole
 */
@Stateful
@TransactionManagement(TransactionManagementType.CONTAINER)
public class CmtEmfStatefulBean {
  EntityManagerFactory emf;

  @TransactionAttribute(TransactionAttributeType.NEVER)
  public void start() {
    // creating the SF should run schema creation
    emf = Persistence.createEntityManagerFactory( "pu-wf-ddl" );
  }

  @Remove
  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void stop() {
    // closing the SF should run the delayed schema drop delegate
    emf.close();
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Stateful
@TransactionManagement(TransactionManagementType.CONTAINER)
public class CmtSfStatefulBean {

  private static SessionFactory sessionFactory;

  @TransactionAttribute(TransactionAttributeType.NEVER)
  public void start() {
    try {
      Configuration configuration = new Configuration();
      configuration = configuration.configure( "hibernate.cfg.xml" );
      configuration.addAnnotatedClass( WildFlyDdlEntity.class );

      sessionFactory = configuration.buildSessionFactory();
    }
    catch (Throwable ex) {
      System.err.println( "Initial SessionFactory creation failed." + ex );
      throw new ExceptionInInitializerError( ex );
    }
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  public void stop() {
    sessionFactory.close();
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Stateful
@TransactionManagement(TransactionManagementType.BEAN)
public class BmtEmfStatefulBean {

代码示例来源:origin: hibernate/hibernate-orm

@Stateful
@TransactionManagement(TransactionManagementType.BEAN)
public class BmtSfStatefulBean {

代码示例来源: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: camunda/camunda-bpm-platform

/**
 * A SFSB with a local business interface 
 * 
 * @author Daniel Meyer
 *
 */
@Stateful
@Local(BusinessInterface.class)
public class LocalSFSBean implements BusinessInterface {

 public boolean doBusiness() {
  return true;
 }

}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * A SFSB with a remote business interface 
 * 
 * @author Daniel Meyer
 *
 */
@Stateful
@Remote(BusinessInterface.class)
public class RemoteSFSBean implements BusinessInterface {

 public boolean doBusiness() {
  return true;
 }

}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

public @Stateful class StockWatcher implements StockWatcherLocal
{
  public void observeStockPrice(@Observes StockPrice price)
  {
   price.recordVisit(this);
  }
    public String getName()
  {
   return StockWatcher.class.getSimpleName();
  }

}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Stateful
public class FooProducer implements FooProducerLocal
{
  @Produces Foo createFoo() { return new Foo(); }
}

代码示例来源:origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Stateful
public class MexicanChihuahua extends Chihuahua implements MexicanChihuahuaLocal
{

  /**
   * 
   */
  private static final long serialVersionUID = 6851776906570623607L;

}

代码示例来源:origin: weld/core

@Alternative
@Priority(StatefulEjbSession.PRIORITY)
@Stateful
public class StatefulEjbSession implements DecoratedInterface {

  public static final int PRIORITY = 2500;

  @Override
  public String testMethod() {
    return "Hello from "+StatefulEjbSession.class.getSimpleName();
  }
}

代码示例来源: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

@Stateful
@ApplicationScoped
@Named @Default
public class Pitbull extends Dog implements PitbullLocal, DogLocal, DogRemote
{
    public static boolean destructorCalled = false;

  @Remove
  public void bye() 
  {
   destructorCalled = true;
  }
}

代码示例来源: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

@Specializes
@Stateful
public class Cow_Broken implements CowLocal_Broken
{

}

相关文章