concept issuemanagerimpl in category flex

This is an excerpt from Manning's book Flex on Java.
CommentManager is also a web service
by virtue of it having the @WebService annotation just as with the IssueManager. It contains a method to return a list of Comment objects by providing an issueId
, a method for deleting all comments for an issue id
, a method for saving a comment
and a method for deleting a comment
. Now let’s provide implementation for the services like IssueManagerImpl.
The IssueManagerImpl also uses the @WebService annotation just as in the interface, but provides the serviceName and endpointInterface attributes
. You provide a default no args constructor
as well as one that will be used by Spring to inject the IssueDao and CommentManager
. Next implement the methods for returning the list of Issue objects
, returning a specific Issue
, and saving an Issue
by delegating the calls to those methods to the IssueDao. The implementation for removing an issue
first deletes any comments for the issue by calling the CommentManager, then removes the issue by calling the remove method on the IssueDao. Now let’s look at the CommentManager.
Like IssueManagerImpl, CommentManagerImpl declares itself to be a WebService
. Next using the @WebService annotation and defines its endpoint interface and service name you create a default no args constructor
as well as one that will be used by Spring to inject your CommentDao
. You implement the methods to get the Comment objects for an issue
, deleting all the Comment objects for an issue
, getting a specific Comment
, saving a Comment
, and deleting a Comment
by delegating to the CommentDAO.
So that you can push messages to the message destination from your Java objects, Spring has given us the MessageTemplate helper class. Inject an instance of the MessageTemplate into the issueService and use it in the IssueManagerImpl. Because the MessageTemplate is configured as a Spring bean, it autodetects the MessageBroker. Otherwise, it would need to be configured.
by virtue of it having the @WebService annotation just as with the IssueManager. It contains a method to return a list of Comment objects by providing an issueId
, a method for deleting all comments for an issue id
, a method for saving a comment
and a method for deleting a comment
. Now let’s provide implementation for the services like IssueManagerImpl.
by delegating the calls to those methods to the IssueDao. The implementation for removing an issue
first deletes any comments for the issue by calling the CommentManager, then removes the issue by calling the remove method on the IssueDao. Now let’s look at the CommentManager.
by delegating to the CommentDAO.