| 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.api.resourceloader.GlobalResourceLoader; |
| 24 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
| 25 | |
import org.springframework.transaction.support.TransactionSynchronization; |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
public class RemoteObjectCleanup implements TransactionSynchronization { |
| 34 | |
|
| 35 | 0 | private static final Logger LOG = Logger.getLogger(RemoteObjectCleanup.class); |
| 36 | |
|
| 37 | |
private QName objectRemoterName; |
| 38 | |
|
| 39 | |
private QName serviceToRemove; |
| 40 | |
|
| 41 | 0 | public RemoteObjectCleanup(QName objectRemoterName, QName serviceToRemove) { |
| 42 | 0 | this.setObjectRemoterName(objectRemoterName); |
| 43 | 0 | this.setServiceToRemove(serviceToRemove); |
| 44 | 0 | } |
| 45 | |
|
| 46 | |
public void afterCompletion(int status) { |
| 47 | 0 | LOG.debug("Removing service: " + this.getServiceToRemove() + " from ObjectRemoter: " + this.getObjectRemoterName()); |
| 48 | 0 | ObjectRemoterService objectRemoter = (ObjectRemoterService) GlobalResourceLoader.getService(this.getObjectRemoterName()); |
| 49 | 0 | objectRemoter.removeService(this.getServiceToRemove()); |
| 50 | 0 | } |
| 51 | |
|
| 52 | |
public void beforeCompletion() { |
| 53 | |
|
| 54 | 0 | } |
| 55 | |
|
| 56 | |
public QName getObjectRemoterName() { |
| 57 | 0 | return this.objectRemoterName; |
| 58 | |
} |
| 59 | |
|
| 60 | |
public void setObjectRemoterName(QName objectRemoterName) { |
| 61 | 0 | this.objectRemoterName = objectRemoterName; |
| 62 | 0 | } |
| 63 | |
|
| 64 | |
public QName getServiceToRemove() { |
| 65 | 0 | return this.serviceToRemove; |
| 66 | |
} |
| 67 | |
|
| 68 | |
public void setServiceToRemove(QName serviceToRemove) { |
| 69 | 0 | this.serviceToRemove = serviceToRemove; |
| 70 | 0 | } |
| 71 | |
|
| 72 | |
public void afterCommit() { |
| 73 | 0 | } |
| 74 | |
|
| 75 | |
public void beforeCommit(boolean readOnly) { |
| 76 | 0 | } |
| 77 | |
|
| 78 | |
public void resume() { |
| 79 | 0 | } |
| 80 | |
|
| 81 | |
public void suspend() { |
| 82 | 0 | } |
| 83 | |
|
| 84 | |
@Override |
| 85 | |
public void flush() { |
| 86 | 0 | } |
| 87 | |
} |