| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
package org.kuali.rice.ksb.messaging.objectremoting; |
| 18 | |
|
| 19 | |
import javax.transaction.Synchronization; |
| 20 | |
import javax.xml.namespace.QName; |
| 21 | |
|
| 22 | |
import org.apache.log4j.Logger; |
| 23 | |
import org.kuali.rice.core.resourceloader.GlobalResourceLoader; |
| 24 | |
import org.springframework.transaction.support.TransactionSynchronization; |
| 25 | |
|
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
public class RemoteObjectCleanup implements TransactionSynchronization { |
| 33 | |
|
| 34 | 0 | private static final Logger LOG = Logger.getLogger(RemoteObjectCleanup.class); |
| 35 | |
|
| 36 | |
private QName objectRemoterName; |
| 37 | |
|
| 38 | |
private QName serviceToRemove; |
| 39 | |
|
| 40 | 0 | public RemoteObjectCleanup(QName objectRemoterName, QName serviceToRemove) { |
| 41 | 0 | this.setObjectRemoterName(objectRemoterName); |
| 42 | 0 | this.setServiceToRemove(serviceToRemove); |
| 43 | 0 | } |
| 44 | |
|
| 45 | |
public void afterCompletion(int status) { |
| 46 | 0 | LOG.debug("Removing service: " + this.getServiceToRemove() + " from ObjectRemoter: " + this.getObjectRemoterName()); |
| 47 | 0 | ObjectRemoterService objectRemoter = (ObjectRemoterService) GlobalResourceLoader.getService(this.getObjectRemoterName()); |
| 48 | 0 | objectRemoter.removeService(this.getServiceToRemove()); |
| 49 | 0 | } |
| 50 | |
|
| 51 | |
public void beforeCompletion() { |
| 52 | |
|
| 53 | 0 | } |
| 54 | |
|
| 55 | |
public QName getObjectRemoterName() { |
| 56 | 0 | return this.objectRemoterName; |
| 57 | |
} |
| 58 | |
|
| 59 | |
public void setObjectRemoterName(QName objectRemoterName) { |
| 60 | 0 | this.objectRemoterName = objectRemoterName; |
| 61 | 0 | } |
| 62 | |
|
| 63 | |
public QName getServiceToRemove() { |
| 64 | 0 | return this.serviceToRemove; |
| 65 | |
} |
| 66 | |
|
| 67 | |
public void setServiceToRemove(QName serviceToRemove) { |
| 68 | 0 | this.serviceToRemove = serviceToRemove; |
| 69 | 0 | } |
| 70 | |
|
| 71 | |
public void afterCommit() { |
| 72 | 0 | } |
| 73 | |
|
| 74 | |
public void beforeCommit(boolean readOnly) { |
| 75 | 0 | } |
| 76 | |
|
| 77 | |
public void resume() { |
| 78 | 0 | } |
| 79 | |
|
| 80 | |
public void suspend() { |
| 81 | 0 | } |
| 82 | |
} |