Complete Java Enterprise Edition 8 specification APIs providing all standardized enterprise application development interfaces
—
EJB API for developing enterprise business components with transaction management, security, and lifecycle support.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Stateless {
String name() default "";
String mappedName() default "";
String description() default "";
}
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Stateful {
String name() default "";
String mappedName() default "";
String description() default "";
String passivationCapable() default "";
}
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Singleton {
String name() default "";
String mappedName() default "";
String description() default "";
}public interface EJBContext {
EJBHome getEJBHome() throws IllegalStateException;
EJBLocalHome getEJBLocalHome() throws IllegalStateException;
Properties getEnvironment();
Identity getCallerIdentity();
Principal getCallerPrincipal();
boolean isCallerInRole(Identity role);
boolean isCallerInRole(String roleName);
UserTransaction getUserTransaction() throws IllegalStateException;
void setRollbackOnly() throws IllegalStateException;
boolean getRollbackOnly() throws IllegalStateException;
TimerService getTimerService() throws IllegalStateException;
Object lookup(String name) throws IllegalArgumentException;
Map<String, Object> getContextData();
}@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PostConstruct;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PreDestroy;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PostActivate;
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface PrePassivate;@Stateless
public class UserService {
@PersistenceContext
private EntityManager em;
@PostConstruct
public void init() {
// Initialization logic
}
public User findUser(Long id) {
return em.find(User.class, id);
}
@PreDestroy
public void cleanup() {
// Cleanup logic
}
}Install with Tessl CLI
npx tessl i tessl/maven-javax--javaee-api