javax.ejb.Local类的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(121)

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

Local介绍

暂无

代码示例

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

/**
 * @author Arun Gupta
 */
@Local
public interface Cart {

  public void addItem(String item);

  public void removeItem(String item);

  public void purchase();

  public List<String> getItems();

}

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

private List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
  final List<Class> allLocalOrRemoteIfaces = new LinkedList<>();
  if (resourceClass.isAnnotationPresent(Remote.class)) {
    allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Remote.class).value()));
  }
  if (resourceClass.isAnnotationPresent(Local.class)) {
    allLocalOrRemoteIfaces.addAll(Arrays.asList(resourceClass.getAnnotation(Local.class).value()));
  }
  for (Class<?> i : resourceClass.getInterfaces()) {
    if (i.isAnnotationPresent(Remote.class) || i.isAnnotationPresent(Local.class)) {
      allLocalOrRemoteIfaces.add(i);
    }
  }
  return allLocalOrRemoteIfaces;
}

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

/**
 * @author Arun Gupta
 */
@Local
public interface Account {

  public String withdraw(float amount);

  public String deposit(float amount);

}

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

private Collection<Class<?>> getLocalBusinessInterfaces(final DeploymentUnit deploymentUnit, final Class<?> sessionBeanClass) throws DeploymentUnitProcessingException {
  final Local localViewAnnotation = sessionBeanClass.getAnnotation(Local.class);
  if (localViewAnnotation == null) {
    Collection<Class<?>> interfaces = getBusinessInterfacesFromInterfaceAnnotations(sessionBeanClass, Local.class);
    if (!interfaces.isEmpty()) {
      return interfaces;
    }
    return Collections.emptySet();
  }
  Class<?>[] localViews = localViewAnnotation.value();
  if (localViews == null || localViews.length == 0) {
    Set<Class<?>> interfaces = getPotentialBusinessInterfaces(sessionBeanClass);
    // For version < 3.2, the EJB spec didn't allow more than one implementing interfaces to be considered as local when the bean class had the @Local annotation without any explicit value.
    // EJB 3.2 allows it (core spec, section 4.9.7)
    if (interfaces.size() != 1 && !isEjbVersionGreaterThanOrEqualTo32(deploymentUnit)) {
      throw EjbLogger.ROOT_LOGGER.beanWithLocalAnnotationImplementsMoreThanOneInterface(sessionBeanClass);
    }
    return interfaces;
  }
  return Arrays.asList(localViews);
}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface ExecutorServiceEJB extends ExecutorService {
  
  Executor getExecutor();    

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface UserTaskServiceEJBLocal extends UserTaskService {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface DeploymentServiceEJBLocal extends DeploymentService, ListenerSupport {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface ProcessInstanceMigrationServiceEJBLocal extends ProcessInstanceMigrationService {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface RuntimeDataServiceEJBLocal extends RuntimeDataService, DeploymentEventListener {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface ProcessServiceEJBLocal extends ProcessService {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface QueryServiceEJBLocal extends QueryService {

}

代码示例来源:origin: kiegroup/jbpm

@Local
public interface DefinitionServiceEJBLocal extends DefinitionService, DeploymentEventListener {

}

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

@Local(MyManagedScheduledBatch.class)
public class MyManagedScheduledBatchBean implements MyManagedScheduledBatch {

代码示例来源:origin: spring-projects/spring-framework

/**
 * EJB implementation of {@link TestEntityDao} which declares transaction
 * semantics for {@link #incrementCount(String)} with
 * {@link TransactionAttributeType#REQUIRED}.
 *
 * @author Sam Brannen
 * @author Xavier Detant
 * @since 4.0.1
 * @see RequiresNewEjbTxTestEntityDao
 */
@Stateless
@Local(TestEntityDao.class)
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class RequiredEjbTxTestEntityDao extends AbstractEjbTxTestEntityDao {

  @Override
  public int getCount(String name) {
    return super.getCountInternal(name);
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRED)
  @Override
  public int incrementCount(String name) {
    return super.incrementCountInternal(name);
  }

}

代码示例来源:origin: spring-projects/spring-framework

/**
 * EJB implementation of {@link TestEntityDao} which declares transaction
 * semantics for {@link #incrementCount(String)} with
 * {@link TransactionAttributeType#REQUIRES_NEW}.
 *
 * @author Sam Brannen
 * @author Xavier Detant
 * @since 4.0.1
 * @see RequiredEjbTxTestEntityDao
 */
@Stateless
@Local(TestEntityDao.class)
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public class RequiresNewEjbTxTestEntityDao extends AbstractEjbTxTestEntityDao {

  @Override
  public int getCount(String name) {
    return super.getCountInternal(name);
  }

  @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
  @Override
  public int incrementCount(String name) {
    return super.incrementCountInternal(name);
  }

}

代码示例来源:origin: jamesagnew/hapi-fhir

@Local
@Stateless

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

/**
 * A SLSB with a local business interface 
 * 
 * @author Daniel Meyer
 *
 */
@Stateless
@Local(BusinessInterface.class)
public class LocalSLSBean implements BusinessInterface {

 public boolean doBusiness() {
  return true;
 }

}

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

@Local(ExecutorService.class)
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class ExecutorServiceBean implements ExecutorService {

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

/**
 * A SLSB with a local business interface
 *
 * @author Daniel Meyer
 *
 */
@Stateless
@Local(StartProcessInterface.class)
public class StartProcessSLSB implements StartProcessInterface {

 public boolean doStartProcess() {

  BpmPlatform.getDefaultProcessEngine()
   .getRuntimeService()
   .startProcessInstanceByKey("callbackProcess");

  return true;
 }

}

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

@Local(ProcessApplicationService.class)
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public class EjbProcessApplicationService implements ProcessApplicationService {

相关文章