Skip to main content

Home/ SoftwareEngineering/ Group items tagged Gravity

Rss Feed Group items tagged

kuni katsuya

Chapter 6. Messaging (Gravity) - 0 views

  • Granite Data Services provides a messaging feature, code name Gravity, implemented as a Comet-like service with AMF3 data polling over HTTP (producer/consumer based architecture)
  • GraniteDS messaging relies on two main AS3 components on the Flex side: org.granite.gravity.Consumer and org.granite.gravity.Producer
  • 6.3. Common Configuration There are three main steps to configure Gravity in an application: Declare the Gravity servlet implementation for your target server in web.xml Declare a messaging service and destination in services-config.xml, mapped to a specific channel definition of type GravityChannel
  • ...10 more annotations...
  • org.granite.gravity.tomcat.GravityTomcatServlet
  • /gravityamf/*
  • 6.3.1. Supported Application Servers
  • GraniteDS provides a generic servlet implementation that can work in any compliant servlet container
  • blocking IO and thus will provide relatively limited scalability
  • GraniteDS thus provides implementations of non blocking messaging for the most popular application servers.
  • asynchronous non blocking servlets
  • JBoss 5+org.granite.gravity.jbossweb.GravityJBossWebServletOnly with APR/NIO enabled (APR highly recommended)
  • GlassFish 3.xorg.granite.gravity.async.GravityAsyncServletUsing Servlet 3.0
  • Tomcat 7.x / Jetty 8.xorg.granite.gravity.async.GravityAsyncServletUsing Servlet 3.0
kuni katsuya

Chapter 2. Usage Scenarios - 0 views

  • Client Options
  • client there are two main choices
  • standard Flex RemoteObject API
  • ...16 more annotations...
  • GraniteDS does not support the standard Consumer and Producer Flex messaging API
  • its own client implementations of these classes org.granite.gravity.Consumer and org.granite.gravity.Producer that provide very similar functionality
  • Tide remoting API with the GraniteDS/Tide server framework integration
  • most advanced features and greatly simplifies asynchronous handling and client data management
  • preferred for new projects
  • Server Options
  • two options
  • GraniteDS service factory
  • RemoteObject API,
  • GraniteDS support for externalization of lazily loaded JPA entities/collections, and support for scalable messaging though Gravity
  • GraniteDS/Tide service factory
  • Tide API
  • full feature set of Tide data management and further integration with data push through Gravity
  • complete support for Spring and Seam security or integration with CDI events
  • Tide/CDI/JPA2/Java EE 6 on JBoss 6/7 or GlassFish 3
  • If you are on a Java EE 6 compliant application server, it is definitely the best option
kuni katsuya

4. Configuration for CDI - Confluence - 0 views

  • In order to initialize GDS/Tide for CDI and Hibernate, you must add granite.jar, granite-hibernate.jar and granite-cdi.jar to your WEB-INF/lib
  • The easiest way to add GraniteDS support to a CDI project in a Servlet 3 compliant container (currently only GlassFish v3) is by adding a configuration class in your project. This class will be scanned by the servlet 3 container and GraniteDS will use the annotation parameters to determine the application configuration
  • GraniteConfig.java import org.granite.config.servlet3.FlexFilter; import org.granite.gravity.config.AbstractMessagingDestination; import org.granite.gravity.config.servlet3.MessagingDestination; import org.granite.tide.cdi.CDIServiceFactory; import org.granite.tide.cdi.Identity; @FlexFilter( tide=true, type="cdi", factoryClass=CDIServiceFactory.class, tideInterfaces={Identity.class} ) public class GraniteConfig { }
  • ...6 more annotations...
  • services-config.xml
  • define manually the endpoint for remote services
  • service initializer in a static block of the main mxml file
  • Cdi.getInstance().addComponentWithFactory("serviceInitializer", DefaultServiceInitializer, { contextRoot: "/my-cdi-app" } );
  • tideAnnotations
  • list of annotation names that enable remote access to CDI beans
kuni katsuya

3. Remoting - Confluence - 0 views

  • Service initializer
  • DefaultServiceInitializer
  • { contextRoot: "/context-root" }
  • ...1 more annotation...
  • It is also possible to define serverName, serverPort and the url mappings for Granite AMF remoting and for Gravity push graniteUrlMapping and gravityUrlMapping.
1 - 4 of 4
Showing 20 items per page