This is the other remoting service previously mentioned. It's picked up by the
context:component-scan because of the Service annotation and
exposed as a Flex remoting service
because of the RemotingDestination annotation. The service exposed is
'personService' based on the class name, but if a value could be passed into
the Service annotation to expose it under a different name
(ex: @Service("otherService")). To explicitly expose or hide methods
the annotations RemotingInclude and RemotingExclude can
be used.
![]() | Note |
|---|---|
Trying to pass the |
Example 1. PersonService
@Service
@RemotingDestination
public class PersonService {
private final PersonDao personDao;
/**
* Constructor
*/
@Autowired
public PersonService(PersonDao personDao) {
this.personDao = personDao;
}
/**
* <p>Deletes person.</p>
*
* <p><strong>Note</strong>: Passing back the person
* from the Flex client causes a problem with Hibernate.</p>
*/
public void remove(int id) {
Person person = personDao.findPersonById(id);
personDao.delete(person);
}
}