org.openwms.core.service.spring
Class ModuleServiceImpl

java.lang.Object
  extended by org.openwms.core.service.spring.ModuleServiceImpl
All Implemented Interfaces:
ModuleService

@Transactional
@Service(value="moduleService")
public class ModuleServiceImpl
extends Object
implements ModuleService

A ModuleServiceImpl is a Spring powered transactional service using a repository to execute simple CRUD operations. This implementation can be autowired with the name "moduleService".

Since:
0.1
Version:
$Revision: 1539 $
Author:
Heiko Scherrer
See Also:
ModuleDao

Field Summary
static String COMPONENT_NAME
          Springs component name.
 
Constructor Summary
ModuleServiceImpl()
           
 
Method Summary
 List<Module> findAll()
          Return a list of all existing Modules.
 void remove(Module module)
          Remove an already existing Module.
 Module save(Module module)
          Save a Module.
 void saveStartupOrder(List<Module> modules)
          Save the startupOrder for a list of Modules.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_NAME

public static final String COMPONENT_NAME
Springs component name.

See Also:
Constant Field Values
Constructor Detail

ModuleServiceImpl

public ModuleServiceImpl()
Method Detail

findAll

@Transactional(readOnly=true)
public List<Module> findAll()
Return a list of all existing Modules. Marked as readOnly transactional method.

Specified by:
findAll in interface ModuleService
Returns:
A list of Modules or an empty list when no Module s exist

saveStartupOrder

public void saveStartupOrder(List<Module> modules)
Save the startupOrder for a list of Modules. The startupOrder of all Modules in the list modules has to be calculated before. It is expected that the list of Modules is already ordered by their startup order. Each Module's startupOrder is synchronized with the persistence storage.

Specified by:
saveStartupOrder in interface ModuleService
Parameters:
modules - The list of Modules to be saved
Throws:
IllegalArgumentException - when modules is null

remove

public void remove(Module module)
Remove an already existing Module. If the Module entity is a transient instance the method returns with no further action.

Specified by:
remove in interface ModuleService
Parameters:
module - Module to be removed
Throws:
IllegalArgumentException - when module is null
ServiceRuntimeException - when the Module to remove was not found

save

public Module save(Module module)
Save a Module. Additionally the startupOrder is re-calculated for a new Module.

Specified by:
save in interface ModuleService
Parameters:
module - Module instance to be saved
Returns:
The saved Module instance
Throws:
IllegalArgumentException - when module is null


Copyright © 2005-2011 openwms.org. All Rights Reserved.