Information Technology Reference
In-Depth Information
5.5.3
JMS Server Generation
The JMS server generation phase performs the same checks as the RMI server
phase to ensure methods matched by pointcuts are defined as public, non-transient
and non-native.
The RemoteJ JMSServer class implements the Spring Framework's
SessionAwareMessageListener interface and provides a skeleton JMS con-
tainer that we use as the basis for the JMS server implementation. The
SessionAwareMessageListener interface contains a single method, onMessage() ,
which is called by the Spring framework's JMS container upon receipt of a JMS
message.
The JMSServer onMessage() implementation contains a generic method to
read the message, extract the Transfer object from the message, create an in-
stance of the class defined in the Transfer object, call the method defined in the
Transfer object after setting its parameter values and set the return value to the
return value from the call. Following the method call, the Transfer object is sent
back to the client using the Spring framework's JmsTemplate class.
In the JMS server generation phase a main method is added to the JMSServer
class, which creates an instance of the JMSServer class, creates an instance of
the Spring framework's DefaultMessageListenerContainer class, configures the
DefaultMessageListenerContainer instance using values contained in the DDL
and calls its setMessageListener() method with the instance of the JMSServer
class as a parameter. The DefaultMessageListenerContainer is then started,
which allows the onMessage() method of the JMSServer class instance to be called
when messages arrive.
In common with the RMI server implementation, the altered JMSServer class
file is written to the server sub-directory located under the directory defined by
the DDL Service statement described in Section 4.3.4.
5.6 REST Protocol Implementation
Representational State Transfer (REST) is not a protocol as such but an architec-
tural style based on an idealised model of the interactions within a web application
and is the foundation for the modern web architecture. REST is intended to invoke
an image of how a well-designed web application behaves where a network of web
pages forms a network of virtual state machines and a user progresses through an
application by selecting a link or submitting a form with each action resulting in
a transition to the next state of an application by transferring a representation of
that state to the user. The web is the largest example of the REST architecture
[39].
In the REST style, software components are recast as network services and
clients request resources from servers using the resource's name and location spec-
ified as a Uniform Resource Locator (URL) [13]. All interaction is synchronous in
Search WWH ::




Custom Search