TechnoBuzz

A Techno Blog, mainly about Java

Jayson JSON

Marshalling : takes your custom objects and converts them to XML, JSON or other serialization formats.

Unmarshalling : creation of custom objects from XML

Gunner Hillert  :  “The easiest way to marshal JSON in Spring MVC is via the Jackson Java JSON-processor

Create JSON response from Spring MVC 3 :  “Spring MVC invokes a MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is enabled automatically when you use the mvc:annotation-driven configuration element with Jackson present in your classpath”

The @ResponseBody annotation is similar to @RequestBody  : ” This annotation can be put on a method and indicates that the return type should be written straight to the HTTP response body (and not placed in a Model, or interpreted as a view name).”

Spring MVC wth @ResponseBody : “Spring will automatically marshall the return value of an annotated method to XML, JSON, etc. ”

From SpringSource : “Underneath the covers, Spring MVC delegates to a HttpMessageConverter to perform the serialization. In this case, Spring MVC invokes a MappingJacksonHttpMessageConverter built on the Jackson JSON processor. This implementation is enabled automatically when you use the mvc:annotation-driven configuration element with Jackson present in your classpath.”

http://jackson.codehaus.org/

http://wiki.fasterxml.com/JacksonInFiveMinutes

http://wiki.fasterxml.com/ObjectMapper

Jackson 2.0

http://www.mkyong.com/spring-mvc/spring-3-mvc-and-json-example/

March 6, 2013 Posted by | IoC, Spring | Leave a comment

JMS Intro

JMS ~ high load where you can add queue’s in front of it to handle weight

Asysnchronous , Message Oriented Middleware

JMS Message Type

Text Message,ObjectMessage,MapMessage..

Queue point to point messaging

Topic – publish /subscribe messaging

A Session is created from the Connection. Unit of work, transactional capability.  Responsible for creation of various JMS message types.

Producer (put message on), Consumer (pull message off)

Apache MQ

Destination – point to point or topic are examples

Spring has a JmsTemplate : delegates to collaborators to handle some of work

Message Converter – conver from objects to messages (SimpleMessageConverter)

DestinationResolver – resolve destination names (DynamicDestinationResolver or JNDIDestinationResolver)

Sending messages – one line methods or callback methods

producer call back or session callbacks

MessageDrivenBeans wait for the message. MessageConverters can be used on recption side.

JMS MessageListener aysnchronous reception

Spring has light light weight mechanism for listen for messages, as compared to EJB

SimpleMessageListenerContainer or DefaultMessageListenerContainer

Spring supports 2 phase commit

July 1, 2010 Posted by | Spring | Leave a comment

Springathon

Testing in Spring 3.0 much better. Use @Setup or @Test , @RunWith  @ContextConfiguration annotations.

Mocks or Stubs ?

What is AOP

  • Capture functionality used throughout app in a single, reusable way, e.g. transaction, logging, security.
  • Transaction management, logging, security are cross cutting concerns cutting across multiple objects.
  • AOP is the implementation of these cross cutting concern.

Join point: a point in the execution of a program such as a method call or a field assignment. e.g., method1 in Class A and method2 in Class B are the join points that require transaction related advice.

Pointcut: An expression that selects one or  more join points. Advice can be associated with a pointcut expression and runs at any join point method.

Advice: Code that is executed at a particular join point that has been selected by a Poincut. Different types of advices are “around,” “before” and “after” advice.

Aspect:  A module that encapsulates pointcuts and advice. e.g., transaction, security, logging in this case.

Spring AOP uses aspectJ expression language: http://www.eclipse.org/aspectj

designator (* package.Class.method*(..))

@Before @AfterReturning @AfterThrowing @After @Around

Transactions

ACID: Atomic, Consistent, Isolated, Durable

ACEGI – former name for spring security ~ every other letter (missing B,D,F,H)

July 1, 2010 Posted by | Spring | Leave a comment

Core Spring via Interface21~SpringSource~VMWare

I am taking the Core Spring Class by VMWARE with Chris Lacy (http://www.chrislacy.net/).

I will note some of the key information I see over the four days.

Building software:

Running software

Dependency Injection

Previous entries on Spring:  DIP Exceptions , Testing , Spring 2.0 , IBatis Spring , Web Flow

June 29, 2010 Posted by | IoC, Spring | Leave a comment

Spring Experience in Blogs

Looks as if I missed a great place to attend a Java conference known as the Spring Experience

The Spring Experience  schedule looks pretty good.

Related: whats-new-and-cool-in-spring-20

December 11, 2006 Posted by | Spring | Leave a comment

Seam

I couple months ago I heard the podcast with Gavin King about Seam. I came across this blog posting talking about Seam. I do see alot more people using EJBs than what was done in the past now that with JPA and IoC all in one. I do not see Spring going away though.

May 28, 2006 Posted by | Hibernate & ORM, IoC, Spring | Leave a comment

Spring Scalibility

Link: POJO Mojo.

But, in the cases where state and/or behavior needs to be shared or coordinated between nodes, a Spring application can scale very nicely

January 20, 2006 Posted by | Spring | Leave a comment

UNC

Just noticed this weblog yesterday on the TarHeels .  They are calling themseleves THT, but I tend to prefer this THT – The Hardball Times

article on Spring with Struts

December 1, 2005 Posted by | Sports, Spring, Struts | Leave a comment