Sunday, September 29, 2013

JEE 7: New features

  1. CDI 1.1
    1. Single point of control
    2. Default enabling, values: all(default),annotated, none
    3. attribute: bean-discovery-mode="all"
    4. CDI @Vetoed : vetos a bean/package
  2. Bean validation 1.1(JSR 349)
    1. improves semantic readability
    2. pre or post conditions are validated before/after constructor
    3. pre/post conditions on method/constructor
      1. e.g. Constructor:  public CardValidator(@NotNull Algorithm algorithm) {;}
  3. Interceptors(JSR318)
    1. @AroundConstructor
    2. @AroundInvoke(not new)
    3. @Priority -> prioritisation standard defined; some constants available in related class(Interceptor.Priority)
  4. Concurrency 1.0
    1. User threads
    2. Simple and advanced design patterns
    3. Default Managed Executer; custom executer can be defined in web.xml
    4. ManagedScheduleExecuter
      1. Submit delayed/periodic tasks
      2. Accessed through JNDI
    5. ManagedThreadFactory
      1. default is auto defined
      2. custom defined in web.xml
      3. Accessed through JNDI
    6. Dynamic proxy
      1. can create ruinable context proxies
  5. JPA 2.1
    1. Schema generation
      1. can declare scripts/ddl in, helps running a sql script on load of application
    2. @Index: allows to create indexes
    3. Unsynchronised persistence context
      1. SynchronizationType.UNSYNCHRONIZED(or SYNCHRONIZED)
      2. em.joinTransactions();
    4. Stored Procedures
      1. NamedStoredProcedureQuery
      2. NamedStoredProcedureParameter
    5. CDI injection into listeners.
    6. Support for multitenancy.
  6. JTA 1.2
    1. @Transactional(value=Transactional.txType.Required, rollbackOn={SQLException.class, JMSException.class},  dontRollbackOn=SQLWarning.class)
    2. @TransactionScoped: lifecycle limited to transaction
    3. can make normal pojos transactional using this annotation
  7. EJB 3.2
    1. passivationCapable
    2. @Asynchronous
    3. @Schedule has persistence = false
  8. JMS 2.0
    1. AutoCloseable
    2. MessageHandler(not new)
    3. JMS context API (JMSContext.class, ctx.createProducer(), ctx.createConsumer(),)
    4. JMSConnectionFactoryDefinition: to define a datasource for JMS messages
      1. JMSConnectionFactoryDefinition(name="", interfaceName="")
      2. JMSConnection EndPoint Definition(name="", interfaceName="") 
  9. Servlet 3.1
    1. Non-blocking I/O - checks read/write availability b4 actually doing it.
      1. ReadListener
      2. WriteListener
    2. Protocol Upgrade
      1. HttpUpgradeHandler
        1. init(WebConnection wc);
        2. destroy();
      2. Improved security
        1. <deny-uncovered-http-methods> : denies all non-secure accesses
  10. WebSocket 1.1
    1. full-duplex bi-directional communication over TCP
    2. annotated server endpoint @javax.websocket.seerver.ServerEndPoint(name="" value="" decoders="MyClass1.class" encoders="MyClass2.class") for server class and @OnMessage on respective method 
    3. usable with porous
    4. removed boilerplate code
    5. Lifecycle callbacks javax.websocket.OnOpen, etc
    6. Annotated client endpoint (@javax.websocket.ClientEndPoint)
    7. programmatic end points also available(any class extending EndPoint.class)
    8. Encoder/Decoder: custom classes extending Encoder/Decoder class
  11. EL 3.0
    1. stand-alone environment support: useful for batch
    2. ELProcessor
  12. JSF 2.2
    1. Faces Flow; @FlowScoped
      1. xxx/xxx/xx/webapp/flow/1.xhtml, 2.xhtml, 3.xhtml (1->2->3)
        1. these are cumulatively defined in flow-flow.xml (declarative)
        2. programatically can be done FlowScoped bean using @FlowDefinitioin
        3. without xml or FlowDefinition it works similar to JSF 2.1
    2. ResourceLibrary Contract
      1. META-INF/contracts/package1/css,js,template.xhtml
      2. META-INF/contracts/package2/css,js,template.xhtml
    3. pass through attributes p:type="email" -> type="email"
    4. h:inputFile for file upload, type Part.class
  13. JAX-RS 2.0
    1. New API to consume rest services
      1. Client, WebTarget, Invocation, Response (all .class)
    2. async client call supported(Future.class)
    3. Async server too
    4. Message filter ClientRequestFilter,ClientResponseFilter
      1. Entity Interceptors - intercept inbound/outbound stream
  14. JSONP 1.0
    1. Json builder, builder.createJsonOject().build(0; JsonOjlect.class JsonParser: to read Json object
  15. Batch processing
    1. chunk style processing => job.xml 
      1. <chunk>
      2. <reader
      3. <processor>
      4. <writer>
    2. Batchlet processing
    3. job/chunk/listeners
    4. Partition: split a job among multiple cores
    5. Creating workflows
  16. JavaMail 1.5
    1. @MailSessionDefinition
  17. JCA 1.7 Java connection architecture
  18. Default resources
    1. JMS connexion factory
    2. JNDI names 
CDI 1.1 (JSR 346) enables finer scanning control and the ability to veto the processing of a class or package. Bean Validation 1.1 (JSR 349) allows for method validation and the ability to pre/post conditions on method and constructors. Interceptors 1.2 (JSR 318) focused on the ability to associate an Interceptor associated with a constructor and the ability to prioritise interceptor bindings.
For Concurrency utilities 1.0 (JSR 236), the emphasis was on ManagedExecutor with a focus on:
* User threads in Java EE applications
* The ability to support simple and advance concurrency design patterns
* And to extend Concurrency Utilities API from Java SE (JSR 166y)
Further emphasis in concurrency was on ManagedThreadFactory and DynamicProxy.
Dynamic Proxy:
* Creates dynamic proxy objects, and adds contextual information available for applications running in Java EE environment
* It supports Classloading, JNDI, Security, …

Also covered as part of concurrency: ManagedExecutor
* User threads in Java EE applications
* Support simple and advance concurrency design patterns
* Extend Concurrency Utilities API from Java SE (JSR 166y)
– java.util.concurrent package

In addition: ManagedScheduledExecutor
* Managed version of ScheduledExecutorService
* Submit delayed or periodic tasks

For JPA 2.1 (JSR 338), standardized database schema generation and the ability to define additional indexes in schema generation were emphasized. JTA 1.2 (JSR 907) was praised for its capacity for transaction management on Managed Beans as a CDI interceptor binding; in addition, it offers CDI scope whose lifecycle is scoped to the currently active JTA transaction.

WebSocket and annotated server endpoint which enables full-duplex bi-directional communication over a single TCP connection.

JSON Builder creates an object model (or an array) in memory by adding elements. JsonParser is an event-based parser that can read JSON data from a stream.

No comments :

Post a Comment