org.openwms.tms.service.spring
Class TransportUnitRemovalListener
java.lang.Object
org.openwms.tms.service.spring.TransportUnitRemovalListener
- All Implemented Interfaces:
- OnRemovalListener<TransportUnit>
@Component
@Transactional
public class TransportUnitRemovalListener
- extends Object
- implements OnRemovalListener<TransportUnit>
A TransportUnitRemovalListener. Is implemented as a Voter to allow the
removal of TransportUnit
s.
- Since:
- 0.1
- Version:
- $Revision: 1583 $
- Author:
- Heiko Scherrer
Method Summary |
boolean |
preRemove(TransportUnit entity)
Do something prior the entity instance is been removed. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TransportUnitRemovalListener
public TransportUnitRemovalListener()
preRemove
public boolean preRemove(TransportUnit entity)
throws RemovalNotAllowedException
- Do something prior the
entity
instance is been removed.
The implementation verifies that no active TransportOrder
s exist,
before a TransportUnit
is going to be removed.
- In case where already 'started'
TransportOrder
s exist it is
not allowed to remove the TransportUnit
therefore an exception is
thrown.
- If
TransportOrder
s in a state less than 'started' exist they
will be canceled and removed. The removal of the TransportUnit
is
accepted.
- Specified by:
preRemove
in interface OnRemovalListener<TransportUnit>
- Parameters:
entity
- The instance to be removed.
- Returns:
true
if removal is allowed, otherwise
false
- Throws:
RemovalNotAllowedException
- when active TransportOrder
s exist for the
TransportUnit
entity.- See Also:
OnRemovalListener.preRemove(org.openwms.core.domain.AbstractEntity)
Copyright © 2005-2011 openwms.org. All Rights Reserved.