describing its parameter object and is therefore not type-safe and its use is subject to many syntax errors.
GraniteDS provides a Java-like reflection API that encapsulates describeType calls and offers a type-safe, object-oriented, set of
reflection classes and methods
caches its results for better performance
supports advanced features such as ApplicationDomain
and namespaces
we believe that providing solid support for
standardized PaaS-based programming and multi-tenancy would delay the
release of Java EE 7 until the spring of 2014
way
too long
defer the remaining aspects of our agenda for PaaS
enablement and multi-tenancy support to
Java EE 8
already laid some of the infrastructure for cloud
support in Java EE 7
possible to define common handlers for particular fault codes on the client-side, and exception converters on the server-side, to convert server exceptions to common fault codes
* instead of *wrapping* the server-side exception and rethrowing it to the client,
** extract only details relevant to the client (eg. include: human-friendly error message and any helpful parametrized data, exclude: stack traces),
** "wrap" it in a generic ServiceException, which gets "thrown" remotely to the client
* client can check ServiceException.getCode() to implement behavior tailored to server-side exception 'type'
An implementation of this interface must be thread safe
If authorization fails, either because the user is not logged in or because it doesn't have required rights, it must throw an appropriate
org.granite.messaging.service.security.SecurityServiceException.
Writing a Security Service
SecurityService interface
nothing to do with a true Flex destination
only one instance of this service is used in the entire web-app
and will be called by concurrent threads
configure
login
This method is called upon each and every service method call invocations (RemoteObject)
or subscribe/publish actions (Consumer/Producer). When used with RemoteObjects,
the authorize method is responsible for checking security, calling the service method, and returning the corresponding result.
authorize
logout
handleSecurityException
default implementation of this method in AbstractSecurityService is to do nothing
security services
are not exposed to outside calls
always have to include this library in either
WEB-INF/lib
support for CDI is included in the library granite-cdi.jar
10.1. Configuration with Servlet 3
On Servlet 3 compliant containers, GraniteDS can use the new APIs to automatically register its own servlets and filters and thus does not need any
particular configuration in web.xml. This automatic setup is triggered when GraniteDS finds a class annotated with
@FlexFilter in one of the application archives:
@FlexFilter declaration will setup an AMF processor for the specified url pattern
tideAnnotations
defines suitable default values
@TideEnabled
@RemoteDestination
always declared by default
tideInterfaces
tideRoles
exceptionConverters
amf3MessageInterceptor
10.3.2. Typesafe Remoting with Dependency Injection
It is possible to benefit from even more type safety by using the annotation [Inject] instead of In.
When using this annotation, the full class name is used to find the target bean in the CDI context instead of the bean name.
Security
integration between the client RemoteObject
credentials and the server-side container security
client-side component named
identity
API to define runtime authorization checks on the Flex UI