Complete Java Enterprise Edition 8 specification APIs providing all standardized enterprise application development interfaces
npx @tessl/cli install tessl/maven-javax--javaee-api@8.0.0Java EE API is the complete Java Enterprise Edition 8 specification implementation providing all standardized enterprise application development interfaces in a single unified library. It combines Web Profile APIs with additional Full Profile enterprise technologies, enabling developers to build comprehensive enterprise applications with standardized APIs for web services, persistence, messaging, security, and transaction management.
pom.xml:<dependency>
<groupId>javax</groupId>
<artifactId>javaee-api</artifactId>
<version>8.0.1</version>
<scope>provided</scope>
</dependency>Java EE APIs are accessed through their respective package namespaces:
// Servlet API
import javax.servlet.*;
import javax.servlet.http.*;
// Enterprise JavaBeans
import javax.ejb.*;
// Java Persistence API
import javax.persistence.*;
// JAX-RS (RESTful Web Services)
import javax.ws.rs.*;
// CDI (Contexts and Dependency Injection)
import javax.enterprise.context.*;
import javax.inject.*;
// JSON Processing and Binding
import javax.json.*;
import javax.json.bind.*;
// Web Services (JAX-WS)
import javax.jws.*;
import javax.xml.ws.*;
// XML Binding (JAXB)
import javax.xml.bind.*;
import javax.xml.bind.annotation.*;// Basic servlet example
@WebServlet("/hello")
public class HelloServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.getWriter().println("Hello, Java EE!");
}
}
// JAX-RS REST endpoint
@Path("/api/users")
@ApplicationScoped
public class UserResource {
@Inject
private UserService userService;
@GET
@Produces(MediaType.APPLICATION_JSON)
public List<User> getUsers() {
return userService.findAll();
}
}
// JPA Entity
@Entity
@Table(name = "users")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Column(nullable = false)
private String name;
// getters and setters
}Java EE 8 API is organized into two main profiles:
The API provides standardized interfaces that are implemented by Java EE application servers like GlassFish, WildFly, WebLogic, and WebSphere.
Web layer APIs for building user interfaces and handling HTTP requests including servlets, JSP, JSF, and WebSocket support.
// Servlet API
public abstract class HttpServlet extends GenericServlet;
public interface HttpServletRequest extends ServletRequest;
public interface HttpServletResponse extends ServletResponse;
// JSF API
public abstract class UIComponent implements StateHolder;
public abstract class FacesContext;
// WebSocket API
@ServerEndpoint(value="/websocket")
public class WebSocketEndpoint;JAX-RS API for building RESTful web services with annotation-driven development and comprehensive client API.
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@HttpMethod("GET")
public @interface GET;
public interface Response;
public abstract class Application;EJB API for developing enterprise business components with transaction management, security, and lifecycle support.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Stateless;
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Stateful;
public interface EJBContext;JPA API for object-relational mapping, entity management, and database operations with JPQL query language.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface Entity;
public interface EntityManager;
public interface Query;
public interface TypedQuery<X>;CDI and javax.inject APIs for dependency injection, contextual lifecycle management, events, and interceptors.
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
public @interface Inject;
public interface BeanManager;
public interface Instance<T>;JSON-P and JSON-B APIs for parsing, generating, and binding JSON data with streaming and object mapping support.
public interface JsonReader extends Closeable;
public interface JsonWriter extends Closeable;
public final class Json;
// JSON Binding
public interface Jsonb extends AutoCloseable;
public final class JsonbBuilder;JMS API for asynchronous messaging with support for queues, topics, and message-driven beans.
public interface ConnectionFactory;
public interface Connection extends AutoCloseable;
public interface Session extends Runnable, AutoCloseable;
public interface MessageProducer extends AutoCloseable;
public interface MessageConsumer extends AutoCloseable;JTA API for declarative and programmatic transaction management with XA resource coordination.
public interface UserTransaction;
public interface TransactionManager;
public interface Transaction;Security APIs including JACC authorization, JASPIC authentication, and Java EE Security for identity management.
// JACC
public abstract class Policy;
public interface PolicyContext;
// Java EE Security
public interface IdentityStore;
public interface HttpAuthenticationMechanism;Bean Validation API for validating JavaBeans using constraint annotations and validation groups.
public interface Validator;
public interface ValidatorFactory;
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface NotNull;JAX-WS API for building SOAP-based web services with annotation-driven development, comprehensive client support, and WSDL generation.
@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
public @interface WebService {
String name() default "";
String targetNamespace() default "";
String serviceName() default "";
String portName() default "";
String wsdlLocation() default "";
String endpointInterface() default "";
}
public class Service {
public static Service create(URL wsdlDocumentLocation, QName serviceName);
public <T> T getPort(QName portName, Class<T> serviceEndpointInterface);
public <T> Dispatch<T> createDispatch(QName portName, Class<T> type, Service.Mode mode);
}JAXB API for binding Java objects to XML representations with annotation-driven marshalling and unmarshalling support.
public abstract class JAXBContext {
public static JAXBContext newInstance(String contextPath) throws JAXBException;
public static JAXBContext newInstance(Class... classesToBeBound) throws JAXBException;
public abstract Marshaller createMarshaller() throws JAXBException;
public abstract Unmarshaller createUnmarshaller() throws JAXBException;
}
@Target({ElementType.TYPE, ElementType.PACKAGE})
@Retention(RetentionPolicy.RUNTIME)
public @interface XmlRootElement {
String name() default "##default";
String namespace() default "##default";
}Additional enterprise APIs including JavaMail, JCA connectors, batch processing, and concurrency utilities.
// JavaMail
public abstract class Message implements Part;
public abstract class Transport;
// Batch Processing
public interface JobOperator;
public interface StepContext;
// Concurrency
public interface ManagedExecutorService extends ExecutorService;